© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
1 reply
Miles

Unifying a JSON column's return type with `drizzle-zod`'s `Json`

By default,
drizzle-zod
drizzle-zod
gives json columns in a table the
Json
Json
type and schema, a utility type it defines (unexported) in the library. Drizzle itself, however, returns a
never
never
value when querying for the value of a json column unless you use the
.$type
.$type
function to give it a type explicitly. What's the best way to bridge this gap such that
drizzle-zod
drizzle-zod
generated schema matches the query's returned type while losing as little type safety as possible?
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

help with drizzle-zod with jsonb column
Drizzle TeamDTDrizzle Team / help
3y ago
drizzle-zod not infering jsonb type properly
Drizzle TeamDTDrizzle Team / help
2y ago
drizzle-zod type infer
Drizzle TeamDTDrizzle Team / help
3y ago
drizzle-zod type errors with latest versions
Drizzle TeamDTDrizzle Team / help
3y ago