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

Commit 01997ae2 by Jan Aagaard Meier

Fix affected rows on delete for sqlite

1 parent 6c6ea4d3
Showing with 2 additions and 2 deletions
...@@ -82,7 +82,7 @@ module.exports = (function() { ...@@ -82,7 +82,7 @@ module.exports = (function() {
//private //private
var getDatabaseMethod = function() { var getDatabaseMethod = function() {
if (this.send('isInsertQuery') || this.send('isUpdateQuery') || (this.sql.toLowerCase().indexOf('CREATE TEMPORARY TABLE'.toLowerCase()) !== -1)) { if (this.send('isInsertQuery') || this.send('isUpdateQuery') || (this.sql.toLowerCase().indexOf('CREATE TEMPORARY TABLE'.toLowerCase()) !== -1) || this.options.type === QueryTypes.BULKDELETE) {
return 'run' return 'run'
} else { } else {
return 'all' return 'all'
...@@ -159,7 +159,7 @@ module.exports = (function() { ...@@ -159,7 +159,7 @@ module.exports = (function() {
} else if (this.sql.indexOf('PRAGMA foreign_keys') !== -1) { } else if (this.sql.indexOf('PRAGMA foreign_keys') !== -1) {
result = results result = results
} else if ([QueryTypes.BULKUPDATE, QueryTypes.BULKDELETE].indexOf(this.options.type) !== -1) { } else if ([QueryTypes.BULKUPDATE, QueryTypes.BULKDELETE].indexOf(this.options.type) !== -1) {
result = metaData.changes result = metaData.changes
} }
this.emit('success', result) this.emit('success', result)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!