perspectives: show row count

This commit is contained in:
Jan Prochazka
2022-09-22 18:23:04 +02:00
parent 59efdd735c
commit 83693e9f2c
5 changed files with 58 additions and 1 deletions

View File

@@ -39,6 +39,7 @@
import { getPerspectiveNodeMenu } from './perspectiveMenu';
import openNewTab from '../utility/openNewTab';
import { getFilterValueExpression } from 'dbgate-filterparser';
import StatusBarTabItem from '../widgets/StatusBarTabItem.svelte';
const dbg = debug('dbgate:PerspectiveTable');
export const activator = createActivator('PerspectiveTable', true, ['Designer']);
@@ -54,6 +55,7 @@
let domWrapper;
let domTable;
let errorMessage;
let rowCount;
let isLoading = false;
const lastVisibleRowIndexRef = createRef(0);
const disableLoadNextRef = createRef(false);
@@ -128,10 +130,13 @@
dataRows = rows;
dbg('data rows', rows);
errorMessage = null;
rowCount = await node.dataProvider.loadRowCount(root.getNodeLoadProps([]));
} catch (err) {
console.error(err);
errorMessage = err.message;
dataRows = null;
rowCount = null;
}
isLoading = false;
// console.log('DISPLAY ROWS', rows);
@@ -531,6 +536,10 @@
{/if}
</div>
{#if rowCount != null}
<StatusBarTabItem text={`Rows: ${rowCount.toLocaleString()}`} />
{/if}
<style>
.wrapper {
overflow: scroll;

View File

@@ -133,8 +133,8 @@
$: tableInfo = rootDb?.tables.find(x => x.pureName == rootObject?.pureName && x.schemaName == rootObject?.schemaName);
$: viewInfo = rootDb?.views.find(x => x.pureName == rootObject?.pureName && x.schemaName == rootObject?.schemaName);
$: dataProvider = new PerspectiveDataProvider(cache, loader);
$: loader = new PerspectiveDataLoader(apiCall);
$: dataProvider = new PerspectiveDataProvider(cache, loader);
$: root =
tableInfo || viewInfo
? new PerspectiveTableNode(