Closed octogonz closed 2 years ago
🤔 Reading the docs more closely, BIT
supports arrays of bits. So maybe it would be counterintuitive for an array-of-length-one to be treated as boolean
.
Seems like a better solution is to change my SQL schema to use INT
for representing boolean values instead of BIT
.
Repro steps:
Create a table with a BIT column:
Insert some rows in the table
Use the
mariadb
NPM package to query the rows:Expected: The
result[0].boolExample
value should be a familiar JavaScript type such astrue
orfalse
Actual: The value is returned as Node.js
Buffer
, which requires an awkward boolean conversion such asresult[0].boolExample.readInt8() !== 0
.