You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified that the bug I'm about to report hasn't been filed before.
Other packages
drizzle-zod@0.8.2
Describe the Bug
For column of type date({ mode: 'string' }) drizzle-zod uses z.string()
But zod 4 has z.iso.date type which represents specifically string iso date: https://zod.dev/api?id=iso-dates which validates format YYYY-MM-DD which is format the column with date({ mode: 'string' }) type will return.
Uh oh!
There was an error while loading. Please reload this page.
Report hasn't been filed before.
Other packages
drizzle-zod@0.8.2
Describe the Bug
For column of type
date({ mode: 'string' })
drizzle-zod usesz.string()
But zod 4 has
z.iso.date
type which represents specifically string iso date: https://zod.dev/api?id=iso-dates which validates formatYYYY-MM-DD
which is format the column withdate({ mode: 'string' })
type will return.Currently there is a test in drizzle-zod for this case which ensures
date({ mode: 'string' })
will becomez.string()
https://github.com/drizzle-team/drizzle-orm/blob/main/drizzle-zod/tests/pg.test.ts#L416
https://github.com/drizzle-team/drizzle-orm/blob/main/drizzle-zod/tests/pg.test.ts#L464
Introducing of this will be a breaking change.
Do you think we can implement such behavior?
Would you be open for a PR for this change?
The text was updated successfully, but these errors were encountered: