mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 16:06:01 +00:00
perspectives: show row count
This commit is contained in:
@@ -203,4 +203,23 @@ export class PerspectiveDataProvider {
|
||||
|
||||
return tableCache.getRowsResult(props);
|
||||
}
|
||||
|
||||
async loadRowCount(props: PerspectiveDataLoadProps): Promise<number> {
|
||||
const tableCache = this.cache.getTableCache(props);
|
||||
|
||||
if (tableCache.allRowCount != null) {
|
||||
return tableCache.allRowCount;
|
||||
}
|
||||
|
||||
const result = await this.loader.loadRowCount({
|
||||
...props,
|
||||
});
|
||||
|
||||
if (result.errorMessage) {
|
||||
throw new Error(result.errorMessage);
|
||||
}
|
||||
|
||||
tableCache.allRowCount = parseInt(result.count);
|
||||
return tableCache.allRowCount;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user