-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Describe what you want
I love the idea of createInsertSchema and createSelectSchema.
However, extending the Zod schemas generated by those functions and importing them in a client component, results in drizzle-zod and drizzle-orm being in the client bundle. That's more than 20 KB gzipped, afaik. Also, TypeScript has a hard time inferring the whole tree back to the table definitions.
Because of that, I propose a codegen feature for drizzle-zod, which would generate z.object(...) code (what e.g. createInsertSchema would produce) in a different file. This way, it can be easily imported in the client and the performance should improve as well.
What do you think?
austinm911, kane50613, miroslavzeman, canuzunoglu, enrique-fernandez-polo and 23 more