mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
perspective mongo fixes
This commit is contained in:
parent
1d85a17533
commit
23b345c898
@ -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
|
||||
|
@ -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=${
|
||||
|
@ -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,
|
||||
|
@ -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(),
|
||||
|
Loading…
Reference in New Issue
Block a user