-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
docsImprovements or additions to documentationImprovements or additions to documentation
Description
Enhancement hasn't been filed before.
- I have verified this enhancement I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Since Drizzle now wants relations rather than schema, how do we type the Drizzle object? I tried using typeof relations with no success, before it was working with typeof schema:
import { drizzle, type NeonDatabase } from 'drizzle-orm/neon-serverless';
import { relations } from '@myworkspace/db';
let db: NeonDatabase<typeof relations>; // <- Doesnt work with relations
export const useDb = (): NeonDatabase<typeof relations> => {
if (!db) {
db = drizzle('DATABASE_URL', {
relations,
casing: 'snake_case',
});
}
return db;
};Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docsImprovements or additions to documentationImprovements or additions to documentation