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

Commit f321cb38 by Mick Hansen

fix sqlite blank create

1 parent 1b7be3e8
...@@ -156,7 +156,9 @@ module.exports = (function() { ...@@ -156,7 +156,9 @@ module.exports = (function() {
insertQuery: function(tableName, attrValueHash) { insertQuery: function(tableName, attrValueHash) {
attrValueHash = Utils.removeNullValuesFromHash(attrValueHash, this.options.omitNull) attrValueHash = Utils.removeNullValuesFromHash(attrValueHash, this.options.omitNull)
var query = "INSERT INTO <%= table %> (<%= attributes %>) VALUES (<%= values %>);"; var query
, valueQuery = "INSERT INTO <%= table %> (<%= attributes %>) VALUES (<%= values %>);"
, emptyQuery = "INSERT INTO <%= table %> DEFAULT VALUES;"
var replacements = { var replacements = {
table: this.quoteIdentifier(tableName), table: this.quoteIdentifier(tableName),
...@@ -166,6 +168,7 @@ module.exports = (function() { ...@@ -166,6 +168,7 @@ module.exports = (function() {
}.bind(this)).join(",") }.bind(this)).join(",")
} }
query = replacements.attributes.length ? valueQuery : emptyQuery
return Utils._.template(query)(replacements) return Utils._.template(query)(replacements)
}, },
......
...@@ -915,8 +915,6 @@ describe(Support.getTestDialectTeaser("HasMany"), function() { ...@@ -915,8 +915,6 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
}) })
}) })
}) })
}).on('sql', function (sql) {
console.log(sql)
}) })
}) })
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!