perspective mongo fixes

This commit is contained in:
Jan Prochazka 2022-10-02 17:48:03 +02:00
parent 1d85a17533
commit 23b345c898
4 changed files with 6 additions and 5 deletions

View File

@ -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

View File

@ -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=${

View File

@ -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,

View File

@ -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(),