fix(sql): preserve file associations and list selection

This commit is contained in:
zipg authored and GitHub committed 2026-08-13 11:44:55 +08:00
1 parent 2e27f7a66a
commit e5a3917f7d
25 files changed
+558 -186

No files matched your search

+3 -1
View File
@@ -1692,7 +1692,7 @@ export const useQueryStore = defineStore("query", () => {
});
}
function openExternalSqlFile(connectionId: string, database: string, path: string, sql: string, version?: QueryTab["externalSqlFileVersion"]) {
function openExternalSqlFile(connectionId: string, database: string, path: string, sql: string, version?: QueryTab["externalSqlFileVersion"], catalog?: string) {
const normalizedPath = normalizeExternalSqlPath(path);
const existing = tabs.value.find((tab) => tab.mode === "query" && tab.externalSqlPath && normalizeExternalSqlPath(tab.externalSqlPath) === normalizedPath);
if (existing) {
@@ -1709,6 +1709,7 @@ export const useQueryStore = defineStore("query", () => {
customTitle: true,
connectionId,
database,
catalog,
sql,
originalSql: sql,
externalSqlPath: path,
@@ -3081,6 +3082,7 @@ export const useQueryStore = defineStore("query", () => {
.updateFileExecutionTarget(tab.savedSqlId, {
connectionId: tab.connectionId,
database: tab.database,
catalog: tab.catalog,
schema: tab.schema,
})
.catch((error) => console.warn("[DBX][saved-sql:target:error]", error));