-
-
Notifications
You must be signed in to change notification settings - Fork 233
Open
Description
First of all, thank you — I really love this project!
When creating a new project using Drizzle as the ORM, the generated setup does not pass the schema to the Drizzle instance. As a result, TypeScript inference fails and Drizzle reports that the schema generic is missing.
Adding the schema import and passing it to the Drizzle config resolves the issue:
import { drizzle } from 'drizzle-orm/node-postgres';
+import * as schema from './schema/auth';
-export const db = drizzle(process.env.DATABASE_URL ?? '');
+export const db = drizzle(process.env.DATABASE_URL ?? '', {
+ schema,
+});After this change, Drizzle correctly infers table types and .query.<tableName> becomes available.
Is this really an issue, or is this the intended behavior for the project?
Metadata
Metadata
Assignees
Labels
No labels