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

Commit 7cc4f96b by Joshua Perry

Fix sqlite double-quoting

1 parent 999d1e35
Showing with 9 additions and 7 deletions
......@@ -302,7 +302,7 @@ module.exports = (function() {
},
showIndexQuery: function(tableName) {
var sql = "PRAGMA INDEX_LIST('<%= tableName %>')"
var sql = "PRAGMA INDEX_LIST(<%= tableName %>)"
return Utils._.template(sql, { tableName: tableName })
},
......@@ -319,10 +319,11 @@ module.exports = (function() {
describeTableQuery: function(tableName, schema, schemaDelimiter) {
var options = {}
options.schema = schema || null
options.schemaDelimiter = schemaDelimiter || null
options.schema = schema
options.schemaDelimiter = schemaDelimiter
options.quoted = false;
var sql = "PRAGMA TABLE_INFO('<%= tableName %>');"
var sql = "PRAGMA TABLE_INFO(<%= tableName %>);"
return Utils._.template(sql, { tableName: this.addSchema({tableName: tableName, options: options})})
},
......@@ -369,11 +370,11 @@ module.exports = (function() {
})
},
startTransactionQuery: function(options) {
startTransactionQuery: function() {
return "BEGIN TRANSACTION;"
},
setAutocommitQuery: function(value) {
setAutocommitQuery: function() {
return "-- SQLite does not support SET autocommit."
},
......@@ -409,7 +410,8 @@ module.exports = (function() {
* @return {String} The generated sql query.
*/
getForeignKeysQuery: function(tableName, schemaName) {
return "PRAGMA foreign_key_list(\"" + tableName + "\")"
var sql = "PRAGMA foreign_key_list(<%= tableName %>)"
return Utils._.template(sql, { tableName: tableName })
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!