kylefarris / node-querybuilder

Node QueryBuilder Adapter for Node.js (tags: nodejs, node, mysql, active record, activerecord, querybuilder, query builder)
49 stars 19 forks source link

Cannot insert with leading zero #20

Closed selfclose closed 6 years ago

selfclose commented 6 years ago

i'm use regular insert

db.get_connection(function (sql) {
    sql.insert('table', {phone: '012345678', function (err, res) {
    }
}

By the way builder cut first zero out

when I check sql.last_query() it became number type 12345678 How to fix it

kylefarris commented 6 years ago

It does seem that there is some code in the library that will detect an all-numeric string and convert it to an integer. I'll see if I can create a quick patch for that that.

kylefarris commented 6 years ago

Fixed in v1.1.0