mysql count(): optimize requested fields
This commit is contained in:
parent
38a9c6ad15
commit
5930a85617
@ -220,6 +220,7 @@ export default class ModelQuery<M extends Model> {
|
||||
this._sortBy = undefined;
|
||||
this._sortDirection = undefined;
|
||||
|
||||
this.fields.splice(0, this.fields.length);
|
||||
this.fields.push('COUNT(*)');
|
||||
let queryResult = await this.execute(connection);
|
||||
return queryResult.results.length;
|
||||
|
Loading…
Reference in New Issue
Block a user