const data = insertCarSchema.parse(input);
await db.insert(carTable).values(data);
^^^^
Error:
Types of property 'color' are incompatible.
Type 'string' is not assignable to type 'SQL\<unknown> | P...
________
(parameter) data: {
...
color: string;
...
}
color after Zod parsing is plain string not desired Color. If I remove $type from pgTable then type error disappears. drizzle-zod should respect $type definition and not give type error.
Report hasn't been filed before.
What version of
drizzle-orm
are you using?0.36.1
What version of
drizzle-kit
are you using?0.24.2
Other packages
drizzle-zod@0.5.1
Describe the Bug
If I use
$type
for column inpgTable
definition:... and use
drizzle-zod
to generate insert schema for table:... then I get type error on second line:
Error:
color
after Zod parsing is plainstring
not desiredColor
. If I remove$type
frompgTable
then type error disappears.drizzle-zod
should respect$type
definition and not give type error.