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

Commit 57d929f7 by Rui Marinho

Update `rowCount` to always return an integer

1 parent cece97a1
Showing with 2 additions and 2 deletions
...@@ -207,7 +207,7 @@ module.exports = (function() { ...@@ -207,7 +207,7 @@ module.exports = (function() {
return results; return results;
} else if (QueryTypes.BULKUPDATE === self.options.type) { } else if (QueryTypes.BULKUPDATE === self.options.type) {
if (!self.options.returning) { if (!self.options.returning) {
return result.rowCount; return parseInt(result.rowCount, 10);
} }
if (!!self.callee && !!self.callee._hasHstoreAttributes) { if (!!self.callee && !!self.callee._hasHstoreAttributes) {
...@@ -218,7 +218,7 @@ module.exports = (function() { ...@@ -218,7 +218,7 @@ module.exports = (function() {
return self.handleSelectQuery(rows); return self.handleSelectQuery(rows);
} else if (QueryTypes.BULKDELETE === self.options.type) { } else if (QueryTypes.BULKDELETE === self.options.type) {
return result.rowCount; return parseInt(result.rowCount, 10);
} else if (self.isUpsertQuery()) { } else if (self.isUpsertQuery()) {
return rows[0].sequelize_upsert; return rows[0].sequelize_upsert;
} else if (self.isInsertQuery() || self.isUpdateQuery()) { } else if (self.isInsertQuery() || self.isUpdateQuery()) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!