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

It seems that drizzle-zod - createInsertSchema and 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 or createInsertSchema results as z.ZodString instead of z.ZodArray<z.ZodString>. My workaround is to overwrite the inferred string of the corresponding column with an augment from zod. Any idea?
4 Replies
sevenwestonroads
sevenwestonroadsOP14mo ago
Thanks !!!
ByteBender
ByteBender14mo ago
whom did you thanked?
sevenwestonroads
sevenwestonroadsOP14mo ago
I was thanking in advance @ByteBender 😂😂🙏
ByteBender
ByteBender14mo ago
your thank wasted btw did you find any solution? I am thinking to join(',') and split(',') every time SkullPixel
Want results from more Discord servers?
Add your server