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
MySQL has tinyint(n), smallint, bigint, float, double, etc. All of these are represented as z.number() in mysql-zod.
Add support for at least a few of the more common numeric types. Examples to enforce min, max, etc:
z.coerce.number() // Force it to be a number
.int() // Make sure it's an integer
.gte(10000) // Greater than or equal to the smallest 5 digit int
.lte(99999) // Less than or equal to the largest 5 digit int
...
someNumber: z.string().transform((val) => {
if (val.length !== 5) ... different ways to handle issue ...
return parseInt(val, 10)
}),
The text was updated successfully, but these errors were encountered:
MySQL has tinyint(n), smallint, bigint, float, double, etc. All of these are represented as z.number() in mysql-zod.
Add support for at least a few of the more common numeric types. Examples to enforce min, max, etc:
The text was updated successfully, but these errors were encountered: