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

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() {
//private
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'
} else {
return 'all'
......@@ -159,7 +159,7 @@ module.exports = (function() {
} else if (this.sql.indexOf('PRAGMA foreign_keys') !== -1) {
result = results
} else if ([QueryTypes.BULKUPDATE, QueryTypes.BULKDELETE].indexOf(this.options.type) !== -1) {
result = metaData.changes
result = metaData.changes
}
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!