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

It seems that drizzle-zod
  • createInsertSchema and createSelectSchema cannot infer correctly an array of text.
y column;
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?
Was this page helpful?