How to provide table schemas to Drizzle with Effect
I'm quite new to Effect and I'm trying to set up Drizzle with Effect passing table schemas.
In a "traditional" Drizzle project, I define the client like so:
I'm trying to set up Drizzle with Effect and so far this is what I've got:
However, here I can't pass the schema to it and when I try to do
However, with this
I know this is happening because we are not providing the table schemas to Drizzle can't infer the tables.
Was anyone able to provide schema to
In a "traditional" Drizzle project, I define the client like so:
I'm trying to set up Drizzle with Effect and so far this is what I've got:
However, here I can't pass the schema to it and when I try to do
await db.query.users.findFirst() I get this error:However, with this
await db.select().from(users).where(eq(users.id, id)); I have no errors.I know this is happening because we are not providing the table schemas to Drizzle can't infer the tables.
Was anyone able to provide schema to
@effect/sql-drizzle/Pg?