mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 03:45:59 +00:00
fixed loading tables with maby FKs
This commit is contained in:
@@ -162,9 +162,20 @@ export class TableGridDisplay extends GridDisplay {
|
||||
|
||||
requireFkTarget(column: DisplayColumn) {
|
||||
const { uniqueName, foreignKey } = column;
|
||||
this.getTableInfo({ schemaName: foreignKey.refSchemaName, pureName: foreignKey.refTableName }).then((table) => {
|
||||
const pureName = foreignKey.refTableName;
|
||||
const schemaName = foreignKey.refSchemaName;
|
||||
if (this.cache.loadingTables.find((x) => x.pureName == pureName && x.schemaName == schemaName)) return;
|
||||
|
||||
this.setCache((cache) => ({
|
||||
...cache,
|
||||
loadingTables: [...cache.loadingTables, { schemaName, pureName }],
|
||||
}));
|
||||
|
||||
this.getTableInfo({ schemaName, pureName }).then((table) => {
|
||||
console.log('Loading table info', schemaName, pureName);
|
||||
this.setCache((cache) => ({
|
||||
...cache,
|
||||
loadingTables: cache.loadingTables.filter((x) => x.schemaName != schemaName || x.pureName != pureName),
|
||||
tables: {
|
||||
...cache.tables,
|
||||
[uniqueName]: table,
|
||||
@@ -173,7 +184,6 @@ export class TableGridDisplay extends GridDisplay {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
processReferences(select: Select, displayedColumnInfo: DisplayedColumnInfo): ReferenceActionResult {
|
||||
const action = combineReferenceActions(
|
||||
this.addJoinsFromExpandedColumns(select, this.columns, 'basetbl', displayedColumnInfo),
|
||||
|
||||
Reference in New Issue
Block a user