fix(objects): save SQL Server object source definitions

This commit is contained in:
t8y2
2026-05-11 12:17:18 +08:00
parent 3c0dbb3e30
commit cb70625bd8
10 changed files with 285 additions and 78 deletions
-20
View File
@@ -319,25 +319,6 @@ async function onClickTable(tableName: string) {
}
}
function openObjectSourceEditor(target: { title: string; sql: string; schema?: string }) {
const tab = activeTab.value;
if (!tab) return;
const existing = queryStore.tabs.find(
(item) =>
item.mode === "query" &&
item.connectionId === tab.connectionId &&
item.database === tab.database &&
item.title === target.title,
);
if (existing) {
queryStore.activeTabId = existing.id;
return;
}
const tabId = queryStore.createTab(tab.connectionId, tab.database, target.title);
if (target.schema) queryStore.updateSchema(tabId, target.schema);
queryStore.updateSql(tabId, target.sql);
}
async function changeActiveConnection(connectionId: string) {
const tab = activeTab.value;
if (!tab) return;
@@ -659,7 +640,6 @@ onUnmounted(() => {
tableName: target.tableName,
})
"
@edit-object-source="openObjectSourceEditor"
@object-schema-change="(schema) => activeTab && queryStore.updateSchema(activeTab.id, schema)"
/>
</div>