mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 16:26:00 +00:00
perspective mongo fixes
This commit is contained in:
@@ -35,6 +35,7 @@ export class PerspectiveCacheTable {
|
|||||||
pureName: string;
|
pureName: string;
|
||||||
bindingColumns?: string[];
|
bindingColumns?: string[];
|
||||||
dataColumns: string[];
|
dataColumns: string[];
|
||||||
|
allColumns?: boolean;
|
||||||
loadedAll: boolean;
|
loadedAll: boolean;
|
||||||
loadedRows: any[] = [];
|
loadedRows: any[] = [];
|
||||||
bindingGroups: { [bindingKey: string]: PerspectiveBindingGroup } = {};
|
bindingGroups: { [bindingKey: string]: PerspectiveBindingGroup } = {};
|
||||||
@@ -103,7 +104,7 @@ export class PerspectiveCache {
|
|||||||
);
|
);
|
||||||
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 && !res.allColumns) {
|
||||||
dbg('Delete cache because incomplete columns', props.pureName, res.dataColumns);
|
dbg('Delete cache because incomplete columns', props.pureName, res.dataColumns);
|
||||||
|
|
||||||
// we have incomplete cache
|
// we have incomplete cache
|
||||||
|
|||||||
@@ -247,10 +247,6 @@ export class PerspectiveDataLoader {
|
|||||||
engineType,
|
engineType,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
if (dataColumns?.length == 0) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dbg?.enabled) {
|
if (dbg?.enabled) {
|
||||||
dbg(
|
dbg(
|
||||||
`LOAD DATA, collection=${props.pureName}, columns=${props.dataColumns?.join(',')}, range=${
|
`LOAD DATA, collection=${props.pureName}, columns=${props.dataColumns?.join(',')}, range=${
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export interface PerspectiveDataLoadProps {
|
|||||||
schemaName?: string;
|
schemaName?: string;
|
||||||
pureName: string;
|
pureName: string;
|
||||||
dataColumns?: string[];
|
dataColumns?: string[];
|
||||||
|
allColumns?: boolean;
|
||||||
orderBy: {
|
orderBy: {
|
||||||
columnName: string;
|
columnName: string;
|
||||||
order: 'ASC' | 'DESC';
|
order: 'ASC' | 'DESC';
|
||||||
@@ -189,6 +190,7 @@ export class PerspectiveDataProvider {
|
|||||||
|
|
||||||
// load missing rows
|
// load missing rows
|
||||||
tableCache.dataColumns = props.dataColumns;
|
tableCache.dataColumns = props.dataColumns;
|
||||||
|
tableCache.allColumns = props.allColumns;
|
||||||
|
|
||||||
const nextRows = await this.loader.loadData({
|
const nextRows = await this.loader.loadData({
|
||||||
...props,
|
...props,
|
||||||
|
|||||||
@@ -944,6 +944,7 @@ export class PerspectiveTableNode extends PerspectiveTreeNode {
|
|||||||
schemaName: this.table.schemaName,
|
schemaName: this.table.schemaName,
|
||||||
pureName: this.table.pureName,
|
pureName: this.table.pureName,
|
||||||
dataColumns: this.getDataLoadColumns(),
|
dataColumns: this.getDataLoadColumns(),
|
||||||
|
allColumns: isMongo,
|
||||||
databaseConfig: this.databaseConfig,
|
databaseConfig: this.databaseConfig,
|
||||||
orderBy: this.getOrderBy(this.table),
|
orderBy: this.getOrderBy(this.table),
|
||||||
sqlCondition: isMongo ? null : this.getChildrenSqlCondition(),
|
sqlCondition: isMongo ? null : this.getChildrenSqlCondition(),
|
||||||
@@ -1154,6 +1155,7 @@ export class PerspectiveCustomJoinTreeNode extends PerspectiveTableNode {
|
|||||||
stableStringify
|
stableStringify
|
||||||
),
|
),
|
||||||
dataColumns: this.getDataLoadColumns(),
|
dataColumns: this.getDataLoadColumns(),
|
||||||
|
allColumns: isMongo,
|
||||||
databaseConfig: this.databaseConfig,
|
databaseConfig: this.databaseConfig,
|
||||||
orderBy: this.getOrderBy(this.table),
|
orderBy: this.getOrderBy(this.table),
|
||||||
sqlCondition: isMongo ? null : this.getChildrenSqlCondition(),
|
sqlCondition: isMongo ? null : this.getChildrenSqlCondition(),
|
||||||
|
|||||||
Reference in New Issue
Block a user