load row count

This commit is contained in:
Jan Prochazka
2020-04-14 19:37:31 +02:00
parent 7137c4a1d4
commit 113016c25c
4 changed files with 64 additions and 3 deletions

View File

@@ -269,7 +269,7 @@ export abstract class GridDisplay {
this.columns.map((col) => ({ ...col, sourceAlias: 'basetbl' })),
'uniqueName'
);
const action = this.processReferences(select, displayedColumnInfo)
const action = this.processReferences(select, displayedColumnInfo);
this.applyFilterOnSelect(select, displayedColumnInfo);
this.applySortOnSelect(select, displayedColumnInfo);
if (action == 'loadRequired') {
@@ -286,4 +286,18 @@ export abstract class GridDisplay {
const sql = treeToSql(this.driver, select, dumpSqlSelect);
return sql;
}
getCountQuery() {
const select = this.createSelect();
select.columns = [
{
exprType: 'raw',
sql: 'COUNT(*)',
alias: 'count',
},
];
select.orderBy = null;
const sql = treeToSql(this.driver, select, dumpSqlSelect);
return sql;
}
}