Integrating `better-auth` with `@effect/sql-drizzle` without initializing separate database conne...
I'm using
This is then used to construct the auth routes, and for retrieving the sessions, etc.
The problem I face is that the entirety of my application is using the
I don't really want to initialise separate database connections for the two (Effect and non-Effect). However, I'm unsure if it's possible to access the database client via
better-auth with drizzle. However, to configure better-auth, you need to do the following and pass in the db client:This is then used to construct the auth routes, and for retrieving the sessions, etc.
The problem I face is that the entirety of my application is using the
@effect/sql-drizzle package which handles the database client construction, etc.I don't really want to initialise separate database connections for the two (Effect and non-Effect). However, I'm unsure if it's possible to access the database client via
yield* PgDrizzle. Alternatively, should I be looking to wrap the better-auth package with Effect, make the auth routes effectful, and then use the @effect/sql-drizzle package to access the database client and construct better-auth?