不要怂,就是干,撸起袖子干!

Commit 1b7f1da3 by overlookmotel

fix: use new whereQuery in SQLlite updateQuery

1 parent f5fc5010
Showing with 3 additions and 3 deletions
...@@ -177,7 +177,7 @@ module.exports = (function() { ...@@ -177,7 +177,7 @@ module.exports = (function() {
attrValueHash = Utils.removeNullValuesFromHash(attrValueHash, options.omitNull, options); attrValueHash = Utils.removeNullValuesFromHash(attrValueHash, options.omitNull, options);
var query = "UPDATE <%= table %> SET <%= values %> WHERE <%= where %>" var query = "UPDATE <%= table %> SET <%= values %> <%= where %>"
, values = []; , values = [];
for (var key in attrValueHash) { for (var key in attrValueHash) {
...@@ -188,10 +188,10 @@ module.exports = (function() { ...@@ -188,10 +188,10 @@ module.exports = (function() {
var replacements = { var replacements = {
table: this.quoteTable(tableName), table: this.quoteTable(tableName),
values: values.join(","), values: values.join(","),
where: this.getWhereConditions(where) where: this.whereQuery(where)
}; };
return Utils._.template(query)(replacements); return Utils._.template(query)(replacements).trim();
}, },
deleteQuery: function(tableName, where, options) { deleteQuery: function(tableName, where, options) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!