© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
2 replies
LukasGaeb

t3stack, multi-file schema, can't use with.

I am using a multi-file schema for my project and the tables are generated appropriately, and the relations are also good. but when trying to use db.query with a "with" inside the query, i am getting an error: Cannot read properties of undefined (reading 'referencedTable')
When doing the same for a single-file schema it works. I suspect that it has to do with the configuration i am using but i cant figure it out. help is very appreachiated. Attached is a screenshot of where i believe is the error (because when importing * as schema from schema for the schema it works). also attached is my drizzle.config.ts
image.png
image.png
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

Multi-File Schemas
Drizzle TeamDTDrizzle Team / help
3y ago
Multi-App Single-Schema
Drizzle TeamDTDrizzle Team / help
3y ago
[BUG] Multi schema tables with same name
Drizzle TeamDTDrizzle Team / help
3y ago
Can't use ts alias in schema related files with drizzle-kit
Drizzle TeamDTDrizzle Team / help
3y ago