feat(pg,kingbase): partition table operations and detail queries

This commit is contained in:
amwps290 authored and GitHub committed 2026-09-21 15:36:49 +08:00
1 parent 882bd130ab
commit 1000aa07b6
62 files changed
+6180 -133

No files matched your search

@@ -7,23 +7,26 @@ export interface TableStructureRefreshScope {
foreignKeys: boolean;
constraints: boolean;
triggers: boolean;
partitions: boolean;
tableComment: boolean;
}
export function visibleTableStructureRefreshScope(activeTab: TableInfoTab): TableStructureRefreshScope {
switch (activeTab) {
case "columns":
return { columns: true, indexes: false, foreignKeys: false, constraints: false, triggers: false, tableComment: true };
return { columns: true, indexes: false, foreignKeys: false, constraints: false, triggers: false, partitions: false, tableComment: true };
case "indexes":
return { columns: true, indexes: true, foreignKeys: false, constraints: false, triggers: false, tableComment: true };
return { columns: true, indexes: true, foreignKeys: false, constraints: false, triggers: false, partitions: false, tableComment: true };
case "foreignKeys":
return { columns: true, indexes: false, foreignKeys: true, constraints: false, triggers: false, tableComment: true };
return { columns: true, indexes: false, foreignKeys: true, constraints: false, triggers: false, partitions: false, tableComment: true };
case "constraints":
return { columns: false, indexes: false, foreignKeys: false, constraints: true, triggers: false, tableComment: true };
return { columns: false, indexes: false, foreignKeys: false, constraints: true, triggers: false, partitions: false, tableComment: true };
case "triggers":
return { columns: false, indexes: false, foreignKeys: false, constraints: false, triggers: true, tableComment: true };
return { columns: false, indexes: false, foreignKeys: false, constraints: false, triggers: true, partitions: false, tableComment: true };
case "partitions":
return { columns: false, indexes: false, foreignKeys: false, constraints: false, triggers: false, partitions: true, tableComment: false };
case "ddl":
return { columns: false, indexes: false, foreignKeys: false, constraints: false, triggers: false, tableComment: true };
return { columns: false, indexes: false, foreignKeys: false, constraints: false, triggers: false, partitions: false, tableComment: true };
}
}
@@ -35,10 +38,14 @@ export function unloadedTableStructureRefreshScope(activeTab: TableInfoTab, load
foreignKeys: visibleScope.foreignKeys && !loadedFacets.has("foreign-keys"),
constraints: visibleScope.constraints && !loadedFacets.has("constraints"),
triggers: visibleScope.triggers && !loadedFacets.has("triggers"),
// Partition metadata has no persisted cache facet; "partitions" is only
// tracked in the loaded-facet set so re-activating the tab does not
// re-fetch in a loop.
partitions: visibleScope.partitions && !loadedFacets.has("partitions"),
tableComment: visibleScope.tableComment && !loadedFacets.has("comment"),
};
}
export function hasTableStructureRefreshWork(scope: TableStructureRefreshScope): boolean {
return scope.columns || scope.indexes || scope.foreignKeys || scope.constraints || scope.triggers || scope.tableComment;
return scope.columns || scope.indexes || scope.foreignKeys || scope.constraints || scope.triggers || scope.partitions || scope.tableComment;
}