Improved support for Boolean type #30
Replies: 1 comment 1 reply
-
I think tinyint(1) could store up to -128to127. If you get it with knex, it returns a number type. I think this is something to consider about changing the type and schema when SELECT and (INSERT, UPDATE). I know it doesn't happen very often, but what if you want to treat a value as a bool value in one table and a number value in another? While I was responding to you, it was time for bed, so I am going to sleep today. |
Beta Was this translation helpful? Give feedback.
-
MySQL provides BOOLEAN or BOOL as the synonym of TINYINT(1).
In
toZod.ts
, only BIT is supported.Zod supports z.boolean() and related coersion and nuances.
It will be helpful for the Zod schema to use z.boolean where we are certain that TINYINT(1) actually represents a Boolean.
On approval I will create and process an Issue.
Beta Was this translation helpful? Give feedback.
All reactions