fix(postgres): prioritize root tables in sidebar pagination

This commit is contained in:
zipg authored and GitHub committed 2026-07-16 14:40:54 +08:00
1 parent 4481cd13f0
commit df0415333a
2 files changed
+7 -4

No files matched your search

+3 -3
View File
@@ -1073,7 +1073,7 @@ export const useConnectionStore = defineStore("connection", () => {
}
function objectGroupCacheKey(node: TreeNode): string {
return schemaCacheKey(node.connectionId || "", node.database || "", node.schema || "", node.type, "objects-v4");
return schemaCacheKey(node.connectionId || "", node.database || "", node.schema || "", node.type, "objects-v5");
}
function metadataListDriverProfile(connectionId?: string): string | undefined {
@@ -3125,7 +3125,7 @@ export const useConnectionStore = defineStore("connection", () => {
await ensureConnected(connectionId);
if (useCachedChildren(node, options)) return;
const simpleObjectDisplay = useSettingsStore().editorSettings.sidebarObjectDisplay === "simple";
const cacheKey = schemaCacheKey(connectionId, database, schema || "", simpleObjectDisplay ? "objects-simple-v4" : "objects-grouped-v4");
const cacheKey = schemaCacheKey(connectionId, database, schema || "", simpleObjectDisplay ? "objects-simple-v5" : "objects-grouped-v5");
const searchFilter = activeTreeLoadSearchFilter(options);
const isSidebarTableSearch = !!options?.sidebarTableSearchParentId;
if (!options?.force && !searchFilter) {
@@ -3383,7 +3383,7 @@ export const useConnectionStore = defineStore("connection", () => {
if (!canApplyTreeMetadataResult(parent)) return;
parent.objectCount = mergedChildren.length;
setChildren(parent, nextChildren);
await savePersistedTreeChildren(schemaCacheKey(parentConnectionId, parentDatabase, parent.schema || "", "objects-simple-v4"), nextChildren);
await savePersistedTreeChildren(schemaCacheKey(parentConnectionId, parentDatabase, parent.schema || "", "objects-simple-v5"), nextChildren);
parent.isExpanded = true;
return;
}