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
When I create zod schema for table with integer column type, the created zod schema does not take into account that postgres integer type for example has range only from -2147483648 to +2147483647https://www.postgresql.org/docs/current/datatype-numeric.html
But the schema does not count it. And I suspect for other db types it does not take their ranges/constraints into account.
And data passed through zod validation will cause error on db side. I suspect a lot of people trust created schema since in docs it is described as type safe.
What version of
drizzle-orm
are you using?0.32.1
What version of
drizzle-kit
are you using?0.23.1
Describe the Bug
When I create zod schema for table with integer column type, the created zod schema does not take into account that postgres
integer
type for example has range only from-2147483648 to +2147483647
https://www.postgresql.org/docs/current/datatype-numeric.htmlBut the schema does not count it. And I suspect for other db types it does not take their ranges/constraints into account.
And data passed through zod validation will cause error on db side. I suspect a lot of people trust created schema since in docs it is described as type safe.
Expected behavior
I would expect zod schema to be like this and throw an error in the case I described above:
Environment & setup
The text was updated successfully, but these errors were encountered: