The MySQL type TINYINT is a number between -128 and 127 (signed) or 0 and 255 (unsigned) so the corresponding type in Typescript should be number, not boolean.
It is true that booleans in MySQL are TINYINTs but the converse is not true. TINYINT is the correct type to use in MySQL for any integer that will fit inside of one byte, not just booleans.
In src/schemaMysql.ts there is a comment which states that the goal is to mirror the types from github.com/mysqljs. That library correctly maps TINYINTs to a number: https://github.com/mysqljs/mysql#type-casting
One more note: I thought it might be possible to look for TINYINT(1) to determine if a field is actually a boolean. Unfortunately, the 1 is merely a formatting hint and does not affect the values that the column can store. Even if it did, it refers to the decimal rather than binary length, so TINYINT(1) could still be any number between 0 and 9 and not a boolean.
The MySQL type
TINYINTis a number between -128 and 127 (signed) or 0 and 255 (unsigned) so the corresponding type in Typescript should benumber, notboolean.It is true that booleans in MySQL are
TINYINTs but the converse is not true.TINYINTis the correct type to use in MySQL for any integer that will fit inside of one byte, not just booleans.In
src/schemaMysql.tsthere is a comment which states that the goal is to mirror the types from github.com/mysqljs. That library correctly maps TINYINTs to a number: https://github.com/mysqljs/mysql#type-castingOne more note: I thought it might be possible to look for
TINYINT(1)to determine if a field is actually a boolean. Unfortunately, the1is merely a formatting hint and does not affect the values that the column can store. Even if it did, it refers to the decimal rather than binary length, soTINYINT(1)could still be any number between 0 and 9 and not a boolean.