feat(dolt): add database-aware version control workspace

This commit is contained in:
hanxuanyu authored and GitHub committed 2026-08-18 11:30:20 +08:00
1 parent 3e6e43c57c
commit cf1476a6dc
29 files changed
+5411 -6

No files matched your search

+28
View File
@@ -77,6 +77,7 @@ import type { SavedSqlFile } from "@/types/database";
import i18n from "@/i18n";
import { translateBackendError } from "@/i18n/backend-errors";
import type { SqlExecutionTargetContext } from "@/lib/database/sqlExecutionTargetRegistry";
import type { DriverProfileWorkspaceScope } from "@/lib/database/driverProfileExtensions";
import type { MultiDbExecutionTarget, MultiDbResultRunExecution } from "@/types/sqlExecution";
const ORACLE_LIKE_METADATA_TYPES = new Set<string>(["oracle", "dameng", "oceanbase-oracle"]);
@@ -1809,6 +1810,32 @@ export const useQueryStore = defineStore("query", () => {
return id;
}
function openDriverProfileWorkspace(connectionId: string, database: string, title: string, mode: QueryTab["mode"], tabScope: DriverProfileWorkspaceScope = "database", workspaceBranch?: string) {
const existing = tabs.value.find((tab) => tab.mode === mode && tab.connectionId === connectionId && (tabScope === "connection" || tab.database === database));
if (existing) {
if (existing.database !== database) updateDatabase(existing.id, database);
existing.workspaceBranch = workspaceBranch;
switchTab(existing.id);
return existing.id;
}
const id = uuid();
tabs.value.push({
id,
title,
connectionId,
database,
workspaceBranch,
sql: "",
isExecuting: false,
isCancelling: false,
isExplaining: false,
mode,
});
activeTabId.value = id;
return id;
}
function switchTab(tabId: string) {
activeTabId.value = tabId;
settingsStore.settingsPageActive = false;
@@ -6095,6 +6122,7 @@ export const useQueryStore = defineStore("query", () => {
rollbackTransaction,
renameTab,
openDatabaseBrowser,
openDriverProfileWorkspace,
openObjectBrowser,
openMongoGridFs,
openMongoBucket,