© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
6 replies
sevenwestonroads

Psql Array of text and `createSelectSchema`, `createInsertSchema`

It seems that
drizzle-zod
drizzle-zod
-
createInsertSchema
createInsertSchema
and
createSelectSchema
createSelectSchema
cannot infer correctly an array of text.

My column;
colName: text('col_name').array()
colName: text('col_name').array()


Indeed, the type of the corresponding column of
createSelectSchema
createSelectSchema
or
createInsertSchema
createInsertSchema
results as
z.ZodString
z.ZodString
instead of
z.ZodArray<z.ZodString>
z.ZodArray<z.ZodString>
.

My workaround is to overwrite the inferred string of the corresponding column with an
augment
augment
from zod.

Any idea?
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

createInsertSchema & createSelectSchema difference
Drizzle TeamDTDrizzle Team / help
3y ago
createSelectSchema & createInsertSchema does not infer array properly
Drizzle TeamDTDrizzle Team / help
3y ago
Wrong drizzle generate with an array of text() in PSQL
Drizzle TeamDTDrizzle Team / help
2y ago
refine and createInsertSchema
Drizzle TeamDTDrizzle Team / help
13mo ago