© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•15mo ago•
1 reply
BBuubbaa

Inferring schema with drizzle-zod in sveltekit app

I am using drizzle orm in a sveltekit app and the logical place to define my db schema is in the lib/server/db directory. I am also using shadcn with superforms, which require a schema definition for validating the inputs (i am using client side validation as well). The problem is that having the table definitions inside the lib/server folder is preventing me from inferring the schemas for my tables with drizzle-zod and use those in client side code.
At the moment I am forced to define a separate schema (basically duplicating information) for insertion. My question would be: has anyone faced this problem, and if so what was you solution? I would be happy to provide more information as needed. Thank you!
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

Drizzle-Zod extend schema....
Drizzle TeamDTDrizzle Team / help
14mo ago
drizzle-zod update schema?
Drizzle TeamDTDrizzle Team / help
3y ago
Zod schema validation from Drizzle schema
Drizzle TeamDTDrizzle Team / help
3y ago
Custom type not inferring correct zod schema?
Drizzle TeamDTDrizzle Team / help
3y ago