hiddentao / squel

:office: SQL query string builder for Javascript
https://hiddentao.github.io/squel
MIT License
1.57k stars 231 forks source link

MSSQL Boolean type #363

Open bminer opened 6 years ago

bminer commented 6 years ago

Unfortunately for Microsoft, their RDBMS does not understand TRUE and FALSE. It only understands 1 and 0.

useFlavour('mssql') should be adjusted to accommodate this inferior database. ;)

Workaround:

const squel = require('squel').useFlavour('mssql');

// Handle booleans better
squel.registerValueHandler('boolean', (val) => val ? '1' : '0');

squel
  .insert()
  // .......