bugfix: convert value to string
This commit is contained in:
parent
1807763a6b
commit
e726c24a83
|
@ -10,7 +10,7 @@ function wrap(db, dir) {
|
||||||
var debug = false;
|
var debug = false;
|
||||||
|
|
||||||
db.escape = function (str) {
|
db.escape = function (str) {
|
||||||
return (str||'').replace(/'/g, "''");
|
return (str||'').toString().replace(/'/g, "''");
|
||||||
};
|
};
|
||||||
|
|
||||||
function lowerFirst(str) {
|
function lowerFirst(str) {
|
||||||
|
@ -42,7 +42,7 @@ function wrap(db, dir) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// PRAGMA schema.table_info(table-name);
|
// PRAGMA schema.table_info(table-name);
|
||||||
//
|
//
|
||||||
function sqlite3GetColumns(tablename, columns, cb) {
|
function sqlite3GetColumns(tablename, columns, cb) {
|
||||||
var sql = "PRAGMA table_info(" + db.escape(tablename) + ")";
|
var sql = "PRAGMA table_info(" + db.escape(tablename) + ")";
|
||||||
|
|
||||||
|
@ -421,6 +421,12 @@ function wrap(db, dir) {
|
||||||
|
|
||||||
sql = cb(fieldable);
|
sql = cb(fieldable);
|
||||||
|
|
||||||
|
if (debug) {
|
||||||
|
console.log('[masterquest-sqlite3] dbwrap.js');
|
||||||
|
console.log(sql);
|
||||||
|
console.log(vals);
|
||||||
|
}
|
||||||
|
|
||||||
while (vals.length) {
|
while (vals.length) {
|
||||||
sql = sql.replace(/\?/, "'" + db.escape(vals.shift()) + "'");
|
sql = sql.replace(/\?/, "'" + db.escape(vals.shift()) + "'");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue