wire sql file execution entry points

This commit is contained in:
SuLe
2026-05-02 05:28:28 +08:00
parent 13724a245d
commit c33afc8cef
4 changed files with 103 additions and 1 deletions
+15
View File
@@ -333,6 +333,15 @@ function openSchemaDiff() {
}
}
function openSqlFileExecution() {
if (props.node.connectionId) {
connectionStore.sqlFileSource = {
connectionId: props.node.connectionId,
database: props.node.database ?? "",
};
}
}
const canExpand = !leafTypes.has(props.node.type);
const canPin = computed(() => pinnableTypes.has(props.node.type));
const isPinned = computed(() => props.node.pinned || connectionStore.isTreeNodePinned(props.node.id));
@@ -444,6 +453,9 @@ async function showMore() {
<ContextMenuItem @click="newQuery">
<TerminalSquare class="w-4 h-4" /> {{ t('contextMenu.newQuery') }}
</ContextMenuItem>
<ContextMenuItem @click="openSqlFileExecution">
<FileCode class="w-4 h-4" /> {{ t('sqlFile.title') }}
</ContextMenuItem>
<ContextMenuSeparator />
<ContextMenuItem @click="refresh">
<RefreshCw class="w-4 h-4" /> {{ t('contextMenu.refreshChildren') }}
@@ -461,6 +473,9 @@ async function showMore() {
<ContextMenuItem @click="newQuery">
<TerminalSquare class="w-4 h-4" /> {{ t('contextMenu.newQuery') }}
</ContextMenuItem>
<ContextMenuItem @click="openSqlFileExecution">
<FileCode class="w-4 h-4" /> {{ t('sqlFile.title') }}
</ContextMenuItem>
<ContextMenuItem @click="refresh">
<RefreshCw class="w-4 h-4" /> {{ t('contextMenu.refreshChildren') }}
</ContextMenuItem>