Seems like the schema generic is missing - did you forget to add it to your DB type?
Hi, I am trying to use Drizzle in a multischema setup. The docs say to make the config and then create the db adapter. I would assume that the folder I set as schema in drizzle.config.ts would automatically pass it to the db client. But I get . Do I have to explicitly define all the schemas I'm using in the db client like: export const database = drizzle(sqlite, {schema1, schema2}) , or is there something wrong? The way it seems in the setup for the docs, all I need is to define the schema folder and the db() should gather the types from it automatically.
5 Replies
Pls
you need to pass the schema in you
drizzle()
init
for each schema I suppose, not sure how it would work otherwiseI figured when you defined it in the config that was good enough for the types to populate, because the get started docs never mention to add the schema to the drizzle() init
So I’m not really 100% sure on how to do it with multiple schemas, but I could prolly just make a barrel file or something
I think the config file is primarily for migrations. You still need to pass it to the
drizzle()
init for runtime code.Gotcha thanks that seems right, it’s weird they don’t have you do that in the docs