mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 02:43:59 +00:00
perspectives: fixed incremental loading
This commit is contained in:
@@ -40,7 +40,9 @@ export class PerspectiveCache {
|
|||||||
tables: { [tableKey: string]: PerspectiveCacheTable } = {};
|
tables: { [tableKey: string]: PerspectiveCacheTable } = {};
|
||||||
|
|
||||||
getTableCache(props: PerspectiveDataLoadProps) {
|
getTableCache(props: PerspectiveDataLoadProps) {
|
||||||
const tableKey = this.stableStringify(_omit(props, ['range', 'bindingValues', 'dataColumns']));
|
const tableKey = this.stableStringify(
|
||||||
|
_pick(props, ['schemaName', 'pureName', 'bindingColumns', 'databaseConfig', 'orderBy'])
|
||||||
|
);
|
||||||
let res = this.tables[tableKey];
|
let res = this.tables[tableKey];
|
||||||
|
|
||||||
if (res && _difference(props.dataColumns, res.dataColumns).length > 0) {
|
if (res && _difference(props.dataColumns, res.dataColumns).length > 0) {
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ export class PerspectiveDataLoader {
|
|||||||
},
|
},
|
||||||
})),
|
})),
|
||||||
selectAll: !dataColumns,
|
selectAll: !dataColumns,
|
||||||
orderBy: dataColumns?.map(columnName => ({
|
orderBy: orderBy?.map(columnName => ({
|
||||||
exprType: 'column',
|
exprType: 'column',
|
||||||
columnName,
|
columnName,
|
||||||
direction: 'ASC',
|
direction: 'ASC',
|
||||||
@@ -106,7 +106,7 @@ export class PerspectiveDataLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dbg?.enabled) {
|
if (dbg?.enabled) {
|
||||||
dbg(`LOAD DATA, table=${props.pureName}, columns=${props.dataColumns?.join(',')}, range=${props.range}}`);
|
dbg(`LOAD DATA, table=${props.pureName}, columns=${props.dataColumns?.join(',')}, range=${props.range?.offset},${props.range?.limit}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await this.apiCall('database-connections/sql-select', {
|
const response = await this.apiCall('database-connections/sql-select', {
|
||||||
|
|||||||
Reference in New Issue
Block a user