TypeCast seems doesnt work
See original GitHub issueconst 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: https://github.com/sidorares/node-mysql2/issues/649 https://github.com/sidorares/node-mysql2/issues/347
How i can turn <Buffer xx> to bool/int? https://dev.mysql.com/doc/refman/8.0/en/bit-type.html
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:16 (14 by maintainers)
Top Results From Across the Web
type casting in C# doesn't work - Stack Overflow
Casting in C# will try to find an appropriate casting operator. If the target object either is an int or has an appropriate...
Read more >Type Casting in Acting... All You Need to Know - City Headshots
It's very common for new actors to worry about being typecast because they don't want to be locked into only playing a particular...
Read more >Is Apex Casting is not transitive? - Salesforce Stack Exchange
Basically, casting a Decimal from an Object reference to an Integer reference is invalid, because it's not a compatible type.
Read more >Completely remove casting ability from PC to TV - Super User
Try this : Open chrome://flags/ in Chrome, type cast in the search field and disable every related option. Restart Chrome. · It doesnt...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
to avoid
delete payload.password
:Now, Whether the feature(typeCast) is supported ?