Effect CommunityEC
Effect Community15mo ago
10 replies
James!

Passing a Schema to PgDrizzle in a Monorepo Setup

Is it possible to pass a schema to PgDrizzle?

I am using a monorepo and am importing my EffectDatabaseLive from another package, I am getting a drizzle type error: Seems like the schema generic is missing - did you forget to add it to your DB type? I assume this is because I am importing it from another package and it's looking in for the drizzle.config inside the package that it's being imported in to.

const DrizzleLive = PgDrizzle.layer.pipe(Layer.provide(EffectPgLive));
export const EffectDatabaseLive = Layer.mergeAll(EffectPgLive, DrizzleLive);


This error pops up when I:

const dbEff = yield* PgDrizzle.PgDrizzle;
yield* dbEff.query. <~ It only suggests the "$drizzleTypeError" field.
Was this page helpful?