diff --git a/packages/datalib/src/PerspectiveCache.ts b/packages/datalib/src/PerspectiveCache.ts index e794e9c4f..e706b8ae4 100644 --- a/packages/datalib/src/PerspectiveCache.ts +++ b/packages/datalib/src/PerspectiveCache.ts @@ -35,6 +35,7 @@ export class PerspectiveCacheTable { pureName: string; bindingColumns?: string[]; dataColumns: string[]; + allColumns?: boolean; loadedAll: boolean; loadedRows: any[] = []; bindingGroups: { [bindingKey: string]: PerspectiveBindingGroup } = {}; @@ -103,7 +104,7 @@ export class PerspectiveCache { ); let res = this.tables[tableKey]; - if (res && _difference(props.dataColumns, res.dataColumns).length > 0) { + if (res && _difference(props.dataColumns, res.dataColumns).length > 0 && !res.allColumns) { dbg('Delete cache because incomplete columns', props.pureName, res.dataColumns); // we have incomplete cache diff --git a/packages/datalib/src/PerspectiveDataLoader.ts b/packages/datalib/src/PerspectiveDataLoader.ts index e1e82f984..0e1a9ee13 100644 --- a/packages/datalib/src/PerspectiveDataLoader.ts +++ b/packages/datalib/src/PerspectiveDataLoader.ts @@ -247,10 +247,6 @@ export class PerspectiveDataLoader { engineType, } = props; - if (dataColumns?.length == 0) { - return []; - } - if (dbg?.enabled) { dbg( `LOAD DATA, collection=${props.pureName}, columns=${props.dataColumns?.join(',')}, range=${ diff --git a/packages/datalib/src/PerspectiveDataProvider.ts b/packages/datalib/src/PerspectiveDataProvider.ts index b2a6ee115..b719d5c25 100644 --- a/packages/datalib/src/PerspectiveDataProvider.ts +++ b/packages/datalib/src/PerspectiveDataProvider.ts @@ -20,6 +20,7 @@ export interface PerspectiveDataLoadProps { schemaName?: string; pureName: string; dataColumns?: string[]; + allColumns?: boolean; orderBy: { columnName: string; order: 'ASC' | 'DESC'; @@ -189,6 +190,7 @@ export class PerspectiveDataProvider { // load missing rows tableCache.dataColumns = props.dataColumns; + tableCache.allColumns = props.allColumns; const nextRows = await this.loader.loadData({ ...props, diff --git a/packages/datalib/src/PerspectiveTreeNode.ts b/packages/datalib/src/PerspectiveTreeNode.ts index c94cd79c3..6074d01ac 100644 --- a/packages/datalib/src/PerspectiveTreeNode.ts +++ b/packages/datalib/src/PerspectiveTreeNode.ts @@ -944,6 +944,7 @@ export class PerspectiveTableNode extends PerspectiveTreeNode { schemaName: this.table.schemaName, pureName: this.table.pureName, dataColumns: this.getDataLoadColumns(), + allColumns: isMongo, databaseConfig: this.databaseConfig, orderBy: this.getOrderBy(this.table), sqlCondition: isMongo ? null : this.getChildrenSqlCondition(), @@ -1154,6 +1155,7 @@ export class PerspectiveCustomJoinTreeNode extends PerspectiveTableNode { stableStringify ), dataColumns: this.getDataLoadColumns(), + allColumns: isMongo, databaseConfig: this.databaseConfig, orderBy: this.getOrderBy(this.table), sqlCondition: isMongo ? null : this.getChildrenSqlCondition(),