mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-31 08:23:34 +00:00
fix(objects): save SQL Server object source definitions
This commit is contained in:
-20
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user