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

Commit 1fcd126b by contra Committed by Sushant

Execute queries parallel in findAndCount - Closes #6695 (#6696)

1 parent 8f2c71c8
Showing with 8 additions and 3 deletions
# Future # Future
- [FIXED] `restore` now uses `field` from `deletedAt` - [FIXED] Execute queries parallel in findAndCount [#6695](https://github.com/sequelize/sequelize/issues/6695)
- [FIXED] `restore` now uses `field` from `deletedAt`
- [FIXED] MSSQL bulkInsertQuery when options and attributes are not passed - [FIXED] MSSQL bulkInsertQuery when options and attributes are not passed
- [FIXED] `DATEONLY` now returns `YYYY-MM-DD` date string [#4858] (https://github.com/sequelize/sequelize/issues/4858) - [FIXED] `DATEONLY` now returns `YYYY-MM-DD` date string [#4858] (https://github.com/sequelize/sequelize/issues/4858)
- [FIXED] Issues with `createFunction` and `dropFunction` (PostgresSQL) - [FIXED] Issues with `createFunction` and `dropFunction` (PostgresSQL)
......
...@@ -1757,14 +1757,18 @@ class Model { ...@@ -1757,14 +1757,18 @@ class Model {
if (countOptions.attributes) { if (countOptions.attributes) {
countOptions.attributes = undefined; countOptions.attributes = undefined;
} }
return this.count(countOptions).then(count => {
const countQuery = this.count(countOptions);
const findQuery = this.findAll(options);
return countQuery.then(count => {
if (count === 0) { if (count === 0) {
return { return {
count: count || 0, count: count || 0,
rows: [] rows: []
}; };
} }
return this.findAll(options).then(results => ({ return findQuery.then(results => ({
count: count || 0, count: count || 0,
rows: results rows: results
})); }));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!