Commit 6160c3c1 by Orlando Vazquez

fix query not beinge executed if no bindings were found

parent d5917371
...@@ -116,6 +116,7 @@ Database.prototype.executeQuery = function(sql, bindings, queryCallback) { ...@@ -116,6 +116,7 @@ Database.prototype.executeQuery = function(sql, bindings, queryCallback) {
} }
function onPrepare(error, statement) { function onPrepare(error, statement) {
if (error) throw error;
if (bindings) { if (bindings) {
if (Object.prototype.toString.call(bindings) === "[object Array]") { if (Object.prototype.toString.call(bindings) === "[object Array]") {
doBindingsByIndex(statement, bindings, doStep); doBindingsByIndex(statement, bindings, doStep);
...@@ -124,6 +125,9 @@ Database.prototype.executeQuery = function(sql, bindings, queryCallback) { ...@@ -124,6 +125,9 @@ Database.prototype.executeQuery = function(sql, bindings, queryCallback) {
// TODO index by keys // TODO index by keys
} }
} }
else {
doStep(statement);
}
} }
this.db.prepare(sql, onPrepare); this.db.prepare(sql, onPrepare);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment