© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•11mo ago
mael

JsonB and $type

I don't get how we're supposed to use jsonb types with drizzle-orm and drizzle-zod
if we use jsonb().$type<SomeType> then it seems that when we use createInsertSchema etc we still need to add a refinement for the field or we have type issues
I created some issues on the repo to have more infos, but perhaps someone here knows what are the best way to handle typed jsonb fields?

issues: https://github.com/drizzle-team/drizzle-orm/issues/4361 and https://github.com/drizzle-team/drizzle-orm/issues/4366
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 not infering jsonb type properly
Drizzle TeamDTDrizzle Team / help
2y ago
Using arrayContains with a jsonb postgres type
Drizzle TeamDTDrizzle Team / help
3y ago
JSONB field and zod validation
Drizzle TeamDTDrizzle Team / help
3mo ago
column "summary" cannot be cast automatically to type jsonb
Drizzle TeamDTDrizzle Team / help
3y ago