© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
3 replies
kilroy

DB type error

I have looked at other help questions for this, but they don't really help me understanding the issues I have.

I can do something like:

import * as schema from "@root/models/user.model";
...
export const db = drizzle(pool, { schema });
import * as schema from "@root/models/user.model";
...
export const db = drizzle(pool, { schema });

I don't really see this on the site or in the docs, or any explanation of why I need to do this. Instead, the docs show that you can throw them into db/schemas/ as whatever files you want and that's it. I do have a drizzle.config.ts file which points towards my schemas and a migrate.ts that works fine.

If I don't do the above I get errors like:

Property 'users' does not exist on type 'DrizzleTypeError<"Seems like the schema generic is missing - did you forget to add it to your DB type?">'.
Property 'users' does not exist on type 'DrizzleTypeError<"Seems like the schema generic is missing - did you forget to add it to your DB type?">'.


So, my questions are:

1. Do I need use the above method of "registering" schemas?
2. Is there a way to add multiple schema files?
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Error when inferring type from db.query
Drizzle TeamDTDrizzle Team / help
3y ago
db push error
Drizzle TeamDTDrizzle Team / help
2y ago
db push error
Drizzle TeamDTDrizzle Team / help
2y ago
Type error?
Drizzle TeamDTDrizzle Team / help
3y ago