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

Commit 41a52af1 by Mick Hansen

Merge pull request #3470 from overlookmotel/fix-sqlite-empty-where-error

fix: use new whereQuery in SQLlite updateQuery
2 parents 645af5d3 1b7f1da3
Showing with 3 additions and 3 deletions
......@@ -177,7 +177,7 @@ module.exports = (function() {
attrValueHash = Utils.removeNullValuesFromHash(attrValueHash, options.omitNull, options);
var query = "UPDATE <%= table %> SET <%= values %> WHERE <%= where %>"
var query = "UPDATE <%= table %> SET <%= values %> <%= where %>"
, values = [];
for (var key in attrValueHash) {
......@@ -188,10 +188,10 @@ module.exports = (function() {
var replacements = {
table: this.quoteTable(tableName),
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) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!