Closed
Description
const mysql2 = require('mysql2');
const pool = mysql2.createPool({
host:'localhost', user: 'admindb', database: 'tests',password:'password',charset:'UTF8MB4_UNICODE_CI',timezone:'Z',
typeCast: (field, next) => {
console.log('typeCast');
if (field.type === "BIT") {
console.log(field);
console.log(field.buffer());
return field.buffer()[0] == 1;
}
return next()
}
});;
const promisePool = pool.promise();
export default {pool, promisePool}
Doesn't call with execute.
dup: #649 #347
How i can turn to bool/int?
https://dev.mysql.com/doc/refman/8.0/en/bit-type.html