Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

feat(sidebar): search grouped views and materialized views

弈秋4df39c147daf
diff --git a/apps/desktop/src/components/sidebar/ConnectionTree.vue b/apps/desktop/src/components/sidebar/ConnectionTree.vue
index 493e077f70..fbf09d2d9a 100644
--- a/apps/desktop/src/components/sidebar/ConnectionTree.vue
+++ b/apps/desktop/src/components/sidebar/ConnectionTree.vue
@@ -63,7 +63,7 @@ import { createFlatTreeIndex, flatTreeRowsChanged, getSidebarTreeRowHeight, SIDE
import { sidebarTreeContextKey } from "@/lib/sidebar/sidebarTreeContext";
import { createSidebarTreeRuntime, sidebarTreeRuntimeKey, type SidebarTreeRuntimeHostInstance } from "@/lib/sidebar/sidebarTreeRuntime";
import { createSidebarPasteHandlerRegistry } from "@/lib/sidebar/sidebarPasteHandlerRegistry";
-import { insertSidebarTableSearchControls, isSidebarTableSearchControlNode } from "@/lib/sidebar/sidebarTableSearchControl";
+import { insertSidebarTableSearchControls, isSidebarTableSearchControlNode, sidebarSearchableObjectGroupTypes } from "@/lib/sidebar/sidebarTableSearchControl";
import { createSidebarTableSearchDebouncer, scheduleExclusiveSidebarTableSearchDebounce } from "@/lib/sidebar/sidebarTableSearchIndex";
import TreeItem from "./TreeItem.vue";
import ProductionContextBadge from "@/components/common/ProductionContextBadge.vue";
@@ -1563,11 +1563,11 @@ provide(sidebarTreeContextKey, {
};
void (async () => {
const parent = findNode(store.treeNodes);
- if (parent?.connectionId && parent.database && (parent.type === "database" || parent.type === "schema" || parent.type === "linked-server-schema" || parent.type === "group-tables")) {
- // Refresh only the tables group. Refreshing the database/schema node
- // also reloads views, routines, triggers, etc., causing a visible
- // redraw of the whole sidebar for a table-only operation.
- if (parent.type === "group-tables") {
+ if (parent?.connectionId && parent.database && (parent.type === "database" || parent.type === "schema" || parent.type === "linked-server-schema" || sidebarSearchableObjectGroupTypes().has(parent.type))) {
+ // Refresh only the searched object group. Refreshing the database/schema
+ // node also reloads views, routines, triggers, etc., causing a visible
+ // redraw of the whole sidebar for a single-group operation.
+ if (sidebarSearchableObjectGroupTypes().has(parent.type)) {
await store.loadObjectGroupChildren(parent, { force: true });
} else if (localTableSearchParentTypes.has(parent.type)) {
await store.loadTables(parent.connectionId, parent.database, parent.schema, { force: true });
diff --git a/apps/desktop/src/components/sidebar/__tests__/ConnectionTree.stickySearchBoundary.spec.ts b/apps/desktop/src/components/sidebar/__tests__/ConnectionTree.stickySearchBoundary.spec.ts
index de7e345f79..99aa8ca1cf 100644
--- a/apps/desktop/src/components/sidebar/__tests__/ConnectionTree.stickySearchBoundary.spec.ts
+++ b/apps/desktop/src/components/sidebar/__tests__/ConnectionTree.stickySearchBoundary.spec.ts
@@ -49,7 +49,9 @@ describe("sticky table search scope boundaries", () => {
it.each(["grouped", "schemas"])(`keeps the database title pinned across %s (row height=${rowHeight})`, (mode) => {
const grouped = mode === "grouped";
const first = node("first", grouped ? "group-tables" : "schema", tables());
- const second = node("second", grouped ? "group-views" : "schema", [node("view", "view")]);
+ // group-procedures has no in-group search control, so this keeps exercising
+ // the boundary where only the first scope carries one (#12901 gave views one).
+ const second = node("second", grouped ? "group-procedures" : "schema", [node("view", "view")]);
const { state, scrollBefore } = fixture([node("conn", "connection", [node("db", "database", [first, second])])], grouped, rowHeight);
scrollBefore("second", 3 * rowHeight);
expect(state.stickyTableSearchNode.value.node.tableSearchParentId).toBe("first");
diff --git a/apps/desktop/src/i18n/locales/az.ts b/apps/desktop/src/i18n/locales/az.ts
index fe1bffbca6..46022ff65a 100644
--- a/apps/desktop/src/i18n/locales/az.ts
+++ b/apps/desktop/src/i18n/locales/az.ts
@@ -500,6 +500,8 @@ export default withEnglishFallback({
searchScopeTable: "Cədvəl",
searchScopeView: "Görünüş",
searchTablesInCurrentScope: "Bu verilənlər bazasında cədvəl axtarışı...",
+ searchViewsInCurrentScope: "Bu verilənlər bazasında görünüş axtarışı...",
+ searchMaterializedViewsInCurrentScope: "Bu verilənlər bazasında materiallaşdırılmış görünüş axtarışı...",
clearTableSearch: "Cədvəl axtarışını təmizlə",
localTableSearch: "Yerli axtarış",
localTableSearchTooltip: "Uzaq sorğular göndərmədən yerli cədvəl indeksində axtarın. Uzaqdan axtarmaq üçün deaktiv edin. İndeksi yaratmaq və ya yeniləmək üçün yeniləmə əməliyyatından istifadə edin.",
diff --git a/apps/desktop/src/i18n/locales/en.ts b/apps/desktop/src/i18n/locales/en.ts
index 5afd7640a8..2c4c2ae9d9 100644
--- a/apps/desktop/src/i18n/locales/en.ts
+++ b/apps/desktop/src/i18n/locales/en.ts
@@ -1392,6 +1392,8 @@ export default {
searchScopeTable: "Table",
searchScopeView: "View",
searchTablesInCurrentScope: "Search tables in this database...",
+ searchViewsInCurrentScope: "Search views in this database...",
+ searchMaterializedViewsInCurrentScope: "Search materialized views in this database...",
clearTableSearch: "Clear table search",
localTableSearch: "Local search",
localTableSearchTooltip: "Search the local table index without remote requests. Turn off to search remotely. Use refresh to build or update the index.",
diff --git a/apps/desktop/src/i18n/locales/es.ts b/apps/desktop/src/i18n/locales/es.ts
index acc3ef227b..13da8fad85 100644
--- a/apps/desktop/src/i18n/locales/es.ts
+++ b/apps/desktop/src/i18n/locales/es.ts
@@ -1191,6 +1191,8 @@ export default withEnglishFallback({
searchScopeTable: "Tabla",
searchScopeView: "Vista",
searchTablesInCurrentScope: "Buscar tablas en esta base de datos...",
+ searchViewsInCurrentScope: "Buscar vistas en esta base de datos...",
+ searchMaterializedViewsInCurrentScope: "Buscar vistas materializadas en esta base de datos...",
clearTableSearch: "Limpiar búsqueda de tablas",
localTableSearch: "Búsqueda local",
localTableSearchTooltip: "Busca en el índice local de tablas sin solicitudes remotas. Desactívalo para buscar de forma remota. Usa actualizar para crear o actualizar el índice.",
diff --git a/apps/desktop/src/i18n/locales/id.ts b/apps/desktop/src/i18n/locales/id.ts
index 3535ff4918..ff49d03a71 100644
--- a/apps/desktop/src/i18n/locales/id.ts
+++ b/apps/desktop/src/i18n/locales/id.ts
@@ -705,6 +705,8 @@ export default withEnglishFallback({
searchScopeTable: "Tabel",
searchScopeView: "Tampilan",
searchTablesInCurrentScope: "Cari tabel di database ini...",
+ searchViewsInCurrentScope: "Cari tampilan di database ini...",
+ searchMaterializedViewsInCurrentScope: "Cari tampilan termaterialisasi di database ini...",
clearTableSearch: "Bersihkan pencarian tabel",
localTableSearch: "Pencarian lokal",
localTableSearchTooltip: "Cari indeks tabel lokal tanpa permintaan jarak jauh. Nonaktifkan untuk mencari secara jarak jauh. Gunakan segarkan untuk membangun atau memperbarui indeks.",
diff --git a/apps/desktop/src/i18n/locales/it.ts b/apps/desktop/src/i18n/locales/it.ts
index 3750ecc932..5a0089eacd 100644
--- a/apps/desktop/src/i18n/locales/it.ts
+++ b/apps/desktop/src/i18n/locales/it.ts
@@ -1179,6 +1179,8 @@ export default withEnglishFallback({
searchScopeTable: "Tabella",
searchScopeView: "Vista",
searchTablesInCurrentScope: "Cerca tabelle in questo database...",
+ searchViewsInCurrentScope: "Cerca viste in questo database...",
+ searchMaterializedViewsInCurrentScope: "Cerca viste materializzate in questo database...",
clearTableSearch: "Cancella ricerca tabelle",
localTableSearch: "Ricerca locale",
localTableSearchTooltip: "Cerca nell'indice locale delle tabelle senza richieste remote. Disattiva per cercare in remoto. Usa aggiorna per creare o aggiornare l'indice.",
diff --git a/apps/desktop/src/i18n/locales/ja.ts b/apps/desktop/src/i18n/locales/ja.ts
index 56052e4f4e..2dba67dd74 100644
--- a/apps/desktop/src/i18n/locales/ja.ts
+++ b/apps/desktop/src/i18n/locales/ja.ts
@@ -1180,6 +1180,8 @@ export default withEnglishFallback({
searchScopeTable: "テーブル",
searchScopeView: "ビュー",
searchTablesInCurrentScope: "このデータベースのテーブルを検索...",
+ searchViewsInCurrentScope: "このデータベースのビューを検索...",
+ searchMaterializedViewsInCurrentScope: "このデータベースのマテリアライズドビューを検索...",
clearTableSearch: "テーブル検索をクリア",
localTableSearch: "ローカル検索",
localTableSearchTooltip: "リモート要求を行わずにローカルのテーブルインデックスを検索します。リモート検索するにはオフにしてください。更新でインデックスを作成または更新します。",
diff --git a/apps/desktop/src/i18n/locales/ko.ts b/apps/desktop/src/i18n/locales/ko.ts
index 04c96f7f12..04f2e47068 100644
--- a/apps/desktop/src/i18n/locales/ko.ts
+++ b/apps/desktop/src/i18n/locales/ko.ts
@@ -1186,6 +1186,8 @@ export default withEnglishFallback({
searchScopeTable: "테이블",
searchScopeView: "뷰",
searchTablesInCurrentScope: "이 데이터베이스에서 테이블 검색...",
+ searchViewsInCurrentScope: "이 데이터베이스에서 뷰 검색...",
+ searchMaterializedViewsInCurrentScope: "이 데이터베이스에서 구체화된 뷰 검색...",
clearTableSearch: "테이블 검색 지우기",
localTableSearch: "로컬 검색",
localTableSearchTooltip: "원격 요청 없이 로컬 테이블 인덱스를 검색합니다. 원격으로 검색하려면 끄세요. 인덱스를 생성하거나 업데이트하려면 새로 고침을 사용하세요.",
diff --git a/apps/desktop/src/i18n/locales/pl.ts b/apps/desktop/src/i18n/locales/pl.ts
index 3091457c5a..07e7f2810b 100644
--- a/apps/desktop/src/i18n/locales/pl.ts
+++ b/apps/desktop/src/i18n/locales/pl.ts
@@ -764,6 +764,8 @@ export default withEnglishFallback({
searchScopeTable: "Tabela",
searchScopeView: "Widok",
searchTablesInCurrentScope: "Szukaj tabel w tej bazie danych...",
+ searchViewsInCurrentScope: "Szukaj widoków w tej bazie danych...",
+ searchMaterializedViewsInCurrentScope: "Szukaj widoków zmaterializowanych w tej bazie danych...",
clearTableSearch: "Wyczyść wyszukiwanie tabel",
localTableSearch: "Wyszukiwanie lokalne",
localTableSearchTooltip: "Przeszukuj lokalny indeks tabel bez zapytań sieciowych. Wyłącz tę opcję, aby szukać zdalnie. Użyj odświeżania, aby utworzyć lub zaktualizować indeks.",
diff --git a/apps/desktop/src/i18n/locales/pt-BR.ts b/apps/desktop/src/i18n/locales/pt-BR.ts
index 25fa843c56..83b7abb77d 100644
--- a/apps/desktop/src/i18n/locales/pt-BR.ts
+++ b/apps/desktop/src/i18n/locales/pt-BR.ts
@@ -1180,6 +1180,8 @@ export default withEnglishFallback({
searchScopeTable: "Tabela",
searchScopeView: "Visão",
searchTablesInCurrentScope: "Pesquisar tabelas neste banco...",
+ searchViewsInCurrentScope: "Pesquisar visões neste banco...",
+ searchMaterializedViewsInCurrentScope: "Pesquisar visões materializadas neste banco...",
clearTableSearch: "Limpar busca de tabelas",
localTableSearch: "Busca local",
localTableSearchTooltip: "Pesquisa o índice local de tabelas sem solicitações remotas. Desative para pesquisar remotamente. Use atualizar para criar ou atualizar o índice.",
diff --git a/apps/desktop/src/i18n/locales/ru.ts b/apps/desktop/src/i18n/locales/ru.ts
index 40eb94c357..fda0ccc15e 100644
--- a/apps/desktop/src/i18n/locales/ru.ts
+++ b/apps/desktop/src/i18n/locales/ru.ts
@@ -1160,6 +1160,8 @@ export default withEnglishFallback({
searchScopeTable: "Таблица",
searchScopeView: "Представление",
searchTablesInCurrentScope: "Поиск таблиц в этой базе данных...",
+ searchViewsInCurrentScope: "Поиск представлений в этой базе данных...",
+ searchMaterializedViewsInCurrentScope: "Поиск материализованных представлений в этой базе данных...",
clearTableSearch: "Очистить поиск таблиц",
localTableSearch: "Локальный поиск",
localTableSearchTooltip: "Поиск по локальному индексу таблиц без удалённых запросов. Отключите для удалённого поиска. Используйте обновление для построения или обновления индекса.",
diff --git a/apps/desktop/src/i18n/locales/th.ts b/apps/desktop/src/i18n/locales/th.ts
index 21efe0b449..829fd5fcd8 100644
--- a/apps/desktop/src/i18n/locales/th.ts
+++ b/apps/desktop/src/i18n/locales/th.ts
@@ -1260,6 +1260,8 @@ export default withEnglishFallback({
searchScopeTable: "ตาราง",
searchScopeView: "View",
searchTablesInCurrentScope: "ค้นหาตารางในฐานข้อมูลนี้...",
+ searchViewsInCurrentScope: "ค้นหามุมมองในฐานข้อมูลนี้...",
+ searchMaterializedViewsInCurrentScope: "ค้นหามุมมองที่ถูกทำให้เป็นรูปธรรมในฐานข้อมูลนี้...",
clearTableSearch: "ล้างการค้นหาตาราง",
localTableSearch: "การค้นหาในเครื่อง",
localTableSearchTooltip: "ค้นหา Index ตารางในเครื่องโดยไม่ส่ง Request ระยะไกล ปิดเพื่อค้นหาระยะไกล ใช้รีเฟรชเพื่อสร้างหรืออัปเดต Index",
diff --git a/apps/desktop/src/i18n/locales/tr.ts b/apps/desktop/src/i18n/locales/tr.ts
index bc28c29c0e..3dc4d1ad60 100644
--- a/apps/desktop/src/i18n/locales/tr.ts
+++ b/apps/desktop/src/i18n/locales/tr.ts
@@ -500,6 +500,8 @@ export default withEnglishFallback({
searchScopeTable: "Tablo",
searchScopeView: "Görünüm",
searchTablesInCurrentScope: "Bu veritabanındaki tabloları ara...",
+ searchViewsInCurrentScope: "Bu veritabanındaki görünümleri ara...",
+ searchMaterializedViewsInCurrentScope: "Bu veritabanındaki somutlaştırılmış görünümleri ara...",
clearTableSearch: "Tablo aramasını temizle",
localTableSearch: "Yerel arama",
localTableSearchTooltip: "Uzak istek olmadan yerel tablo dizinini arayın. Uzaktan aramak için kapatın. Dizini oluşturmak veya güncellemek için yenile düğmesini kullanın.",
diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.ts
index bb1e0e4f68..a7e098d930 100644
--- a/apps/desktop/src/i18n/locales/zh-CN.ts
+++ b/apps/desktop/src/i18n/locales/zh-CN.ts
@@ -1328,6 +1328,8 @@ export default withEnglishFallback({
searchScopeTable: "表",
searchScopeView: "视图",
searchTablesInCurrentScope: "搜索当前库的表...",
+ searchViewsInCurrentScope: "搜索当前库的视图...",
+ searchMaterializedViewsInCurrentScope: "搜索当前库的物化视图...",
clearTableSearch: "清除表搜索",
localTableSearch: "本地搜索",
localTableSearchTooltip: "开启后搜索本地表索引,不发送远程请求;关闭后使用远程搜索。请使用刷新按钮构建或更新索引。",
diff --git a/apps/desktop/src/i18n/locales/zh-TW.ts b/apps/desktop/src/i18n/locales/zh-TW.ts
index a96cc78a79..47bd4a4540 100644
--- a/apps/desktop/src/i18n/locales/zh-TW.ts
+++ b/apps/desktop/src/i18n/locales/zh-TW.ts
@@ -1163,6 +1163,8 @@ export default withEnglishFallback({
searchScopeTable: "資料表",
searchScopeView: "檢視",
searchTablesInCurrentScope: "搜尋目前資料庫的資料表...",
+ searchViewsInCurrentScope: "搜尋目前資料庫的檢視表...",
+ searchMaterializedViewsInCurrentScope: "搜尋目前資料庫的具體化檢視表...",
clearTableSearch: "清除資料表搜尋",
localTableSearch: "本機搜尋",
localTableSearchTooltip: "使用本機資料表索引搜尋,不會發出遠端請求。關閉後改用遠端搜尋;使用重新整理建立或更新索引。",
diff --git a/apps/desktop/src/lib/sidebar/__tests__/sidebarViewGroupSearch.spec.ts b/apps/desktop/src/lib/sidebar/__tests__/sidebarViewGroupSearch.spec.ts
new file mode 100644
index 0000000000..a3008b25ef
--- /dev/null
+++ b/apps/desktop/src/lib/sidebar/__tests__/sidebarViewGroupSearch.spec.ts
@@ -0,0 +1,64 @@
+import { describe, expect, it } from "vitest";
+import { filterLocallySearchedTables, localTableSearchParentTypes } from "@/lib/sidebar/sidebarSearchTree";
+import { insertSidebarTableSearchControls } from "@/lib/sidebar/sidebarTableSearchControl";
+import type { FlatTreeNode } from "@/composables/useFlatTree";
+import type { TreeNode } from "@/types/database";
+
+function groupNode(type: TreeNode["type"], children: TreeNode[]): TreeNode {
+ return {
+ id: `conn:db@${type}`,
+ label: type,
+ type,
+ connectionId: "conn",
+ database: "app",
+ isExpanded: true,
+ children,
+ };
+}
+
+function child(type: TreeNode["type"], name: string): TreeNode {
+ return { id: `conn:db@${type}:${name}`, label: name, type, connectionId: "conn", database: "app" };
+}
+
+function flat(nodes: TreeNode[], depth = 0): FlatTreeNode[] {
+ const out: FlatTreeNode[] = [];
+ for (const node of nodes) {
+ out.push({ node, depth, id: node.id, renderKey: node.id, type: node.type, poolType: `${node.type}:${node.id}` });
+ if (node.children?.length) out.push(...flat(node.children, depth + 1));
+ }
+ return out;
+}
+
+describe("sidebar search for view groups (#12901)", () => {
+ it("offers the search control on grouped views and materialized views", () => {
+ const tree = [groupNode("group-tables", [child("table", "orders")]), groupNode("group-views", [child("view", "active_users")]), groupNode("group-materialized-views", [child("materialized_view", "daily_sales")])];
+ const withControls = insertSidebarTableSearchControls(flat(tree), {
+ enabled: true,
+ sidebarObjectDisplay: "grouped",
+ activeQueries: {},
+ });
+ const controlParents = withControls.filter(({ node }) => node.type === "table-search-control").map(({ node }) => node.tableSearchParentId);
+ expect(controlParents).toHaveLength(3);
+ expect(controlParents).toContain("conn:db@group-tables");
+ expect(controlParents).toContain("conn:db@group-views");
+ expect(controlParents).toContain("conn:db@group-materialized-views");
+ });
+
+ it("filters grouped view children by the local query, case-insensitively", () => {
+ const views = groupNode("group-views", [child("view", "ActiveUsers"), child("view", "archived_sessions")]);
+ const filtered = filterLocallySearchedTables([views], {
+ enabled: true,
+ queries: { "conn:db@group-views": "active" },
+ indexedResults: {},
+ });
+ expect(filtered[0]?.children?.map((node) => node.label)).toEqual(["ActiveUsers"]);
+ // Clearing the query restores the full list.
+ const restored = filterLocallySearchedTables([views], { enabled: true, queries: { "conn:db@group-views": "" }, indexedResults: {} });
+ expect(restored[0]?.children).toHaveLength(2);
+ });
+
+ it("registers the view group types as local search parents", () => {
+ expect(localTableSearchParentTypes.has("group-views")).toBe(true);
+ expect(localTableSearchParentTypes.has("group-materialized-views")).toBe(true);
+ });
+});
diff --git a/apps/desktop/src/lib/sidebar/sidebarSearchTree.ts b/apps/desktop/src/lib/sidebar/sidebarSearchTree.ts
index c8f72c7601..034e764b66 100644
--- a/apps/desktop/src/lib/sidebar/sidebarSearchTree.ts
+++ b/apps/desktop/src/lib/sidebar/sidebarSearchTree.ts
@@ -80,7 +80,7 @@ export function reuseLiveSidebarTreeNodes(indexedNodes: TreeNode[], liveNodes: r
return indexedNodes.map((node) => liveNodesById.get(node.id) ?? node);
}
-export const localTableSearchParentTypes = new Set<TreeNodeType>(["database", "schema", "linked-server-schema", "group-tables"]);
+export const localTableSearchParentTypes = new Set<TreeNodeType>(["database", "schema", "linked-server-schema", "group-tables", "group-views", "group-materialized-views"]);
const localTableSearchChildTypes = new Set<TreeNodeType>(["table", "view", "materialized_view"]);
interface LocalTableSearchOptions {
diff --git a/apps/desktop/src/lib/sidebar/sidebarTableSearchControl.ts b/apps/desktop/src/lib/sidebar/sidebarTableSearchControl.ts
index 65c4a47716..0ec9ddfd7e 100644
--- a/apps/desktop/src/lib/sidebar/sidebarTableSearchControl.ts
+++ b/apps/desktop/src/lib/sidebar/sidebarTableSearchControl.ts
@@ -3,6 +3,14 @@ import type { TreeNode, TreeNodeType } from "@/types/database";
const simpleObjectParentTypes = new Set<TreeNodeType>(["database", "schema", "linked-server-schema"]);
const tableSearchableChildTypes = new Set<TreeNodeType>(["table", "view", "materialized_view", "load-more"]);
+// Grouped views and materialized views get the same in-group search box as
+// tables (#12901): their index scope, local filter and remote search plumbing
+// are already object-type generic.
+const searchableObjectGroupTypes = new Set<TreeNodeType>(["group-tables", "group-views", "group-materialized-views"]);
+
+export function sidebarSearchableObjectGroupTypes(): ReadonlySet<TreeNodeType> {
+ return searchableObjectGroupTypes;
+}
export function isSidebarTableSearchControlNode(node: TreeNode): boolean {
return node.type === "table-search-control";
@@ -21,16 +29,21 @@ function shouldInsertTableSearchControl(item: FlatTreeNode, sidebarObjectDisplay
const node = item.node;
if (!node.isExpanded) return false;
if (sidebarObjectDisplay === "grouped") {
- return node.type === "group-tables" && (parentHasSearchableTableList(node) || !!activeQueries[node.id]?.trim());
+ return searchableObjectGroupTypes.has(node.type) && (parentHasSearchableTableList(node) || !!activeQueries[node.id]?.trim());
}
if (!simpleObjectParentTypes.has(node.type)) return false;
return parentHasSearchableTableList(node) || !!activeQueries[node.id]?.trim();
}
+const tableSearchControlLabels: Partial<Record<TreeNodeType, string>> = {
+ "group-views": "sidebar.searchViewsInCurrentScope",
+ "group-materialized-views": "sidebar.searchMaterializedViewsInCurrentScope",
+};
+
function buildTableSearchControlNode(parent: TreeNode): TreeNode {
return {
id: tableSearchControlId(parent.id),
- label: "sidebar.searchTablesInCurrentScope",
+ label: tableSearchControlLabels[parent.type] ?? "sidebar.searchTablesInCurrentScope",
type: "table-search-control",
connectionId: parent.connectionId,
database: parent.database,