K
Kysely12mo ago
Samuel

TINYINT convert to bool

hello, i am using kysely with a mysql dialect and i find myself in a situation where some fields in JSON are just 1 instead of being true is there any way to change this?
Solution:
``` typeCast(field, next) { if (field.type === 'TINY' && field.length === 1) { return field.string() === '1' } else {...
Jump to solution
1 Reply
Solution
Samuel
Samuel12mo ago
typeCast(field, next) {
if (field.type === 'TINY' && field.length === 1) {
return field.string() === '1'
} else {
return next();
}
}
typeCast(field, next) {
if (field.type === 'TINY' && field.length === 1) {
return field.string() === '1'
} else {
return next();
}
}
soultion was to use a typecast
Want results from more Discord servers?
Add your server