From 840082d73b7657bdae65ccb49e8c7adfe6169f46 Mon Sep 17 00:00:00 2001 From: Bagus Wahyu Aprianto Date: Tue, 18 Aug 2026 09:50:35 +0700 Subject: [PATCH] feat(sidebar): add table New Query action --- .../components/sidebar/SidebarTreeRuntimeHost.vue | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/components/sidebar/SidebarTreeRuntimeHost.vue b/apps/desktop/src/components/sidebar/SidebarTreeRuntimeHost.vue index 2609cf12fa..aa8d609078 100644 --- a/apps/desktop/src/components/sidebar/SidebarTreeRuntimeHost.vue +++ b/apps/desktop/src/components/sidebar/SidebarTreeRuntimeHost.vue @@ -1558,7 +1558,19 @@ async function newQuery() { connectionStore.activeConnectionId = node.connectionId; if (hasTreeNodeDatabaseContext(node)) { if (node.type === "table" || node.type === "view" || node.type === "materialized_view") { - await newSelectTemplate(); + const config = connectionStore.getConfig(node.connectionId); + const dbType = config ? effectiveDatabaseTypeForConnection(config) : undefined; + const identifierQuote = connectionStore.connectionIdentifierQuote(node.connectionId); + const sql = buildTableSelectTemplate({ + databaseType: dbType, + identifierQuote, + catalog: node.catalog, + database: node.database, + schema: node.schema, + tableName: node.label, + columns: [], + }); + openSqlTemplateTab(node.connectionId, node.database, node.schema, node.catalog, sql); return; } queryStore.createTab(node.connectionId, node.database, undefined, "query", node.schema, undefined, node.catalog); @@ -4979,6 +4991,7 @@ function buildObjectSidebarMenu(context: SidebarMenuFactoryContext): boolean { } const destructiveActions: ContextMenuItem[] = []; items.push(copyNameMenuItem()); + items.push({ label: t("contextMenu.newQuery"), action: newQuery, icon: TerminalSquare }); items.push({ label: "", separator: true }); items.push({ label: t("contextMenu.viewData"), action: openDataImmediately, icon: TableProperties }); items.push({