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(grid): include comments in column search

t8y243ff5a91e75f
diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue
index 8f795f60c2..907803a2fa 100644
--- a/apps/desktop/src/components/grid/DataGrid.vue
+++ b/apps/desktop/src/components/grid/DataGrid.vue
@@ -201,6 +201,7 @@ import type { DataGridSortDirection, DataGridSortMode } from "@/lib/dataGrid/dat
import { DATA_GRID_COMPACT_TOPBAR_WIDTH, type DataGridReloadIntent, type DataGridToolbarActionCapability, type DataGridToolbarAutoRefreshCapability, type DataGridToolbarSaveCapability } from "@/lib/dataGrid/dataGridToolbar";
import { getTableMetadataCapabilities } from "@/lib/table/tableMetadataCapabilities";
import { getTableStructureCapabilities } from "@/lib/table/tableStructureCapabilities";
+import { filterObjectBrowserTableColumns } from "@/lib/table/objectBrowserTableInfo";
import { reserveDataGridHeaderLine } from "@/lib/dataGrid/dataGridHeaderLayout";
import { supportsTableStructureEditing } from "@/lib/database/databaseCapabilities";
import { rememberDataGridConditionHistory } from "@/lib/dataGrid/dataGridConditionHistory";
@@ -7081,11 +7082,7 @@ onUnmounted(() => {
stopLoadingElapsedTimer();
});
-const filteredColumns = computed(() => {
- if (!searchQuery.value) return props.tableMeta?.columns ?? [];
- const q = searchQuery.value.toLowerCase();
- return (props.tableMeta?.columns ?? []).filter((c) => c.name.toLowerCase().includes(q) || c.data_type.toLowerCase().includes(q));
-});
+const filteredColumns = computed(() => filterObjectBrowserTableColumns(props.tableMeta?.columns ?? [], searchQuery.value));
const filteredIndexes = computed(() => {
if (!searchQuery.value) return indexes.value;
diff --git a/packages/app-tests/objectBrowserTableInfo.test.ts b/packages/app-tests/objectBrowserTableInfo.test.ts
index 7063ba3f83..04f7db0e7d 100644
--- a/packages/app-tests/objectBrowserTableInfo.test.ts
+++ b/packages/app-tests/objectBrowserTableInfo.test.ts
@@ -1,4 +1,5 @@
import { strict as assert } from "node:assert";
+import { readFileSync } from "node:fs";
import { test } from "vitest";
import { filterObjectBrowserTableColumns } from "../../apps/desktop/src/lib/table/objectBrowserTableInfo.ts";
@@ -46,3 +47,9 @@ test("returns every column for empty searches and preserves match order", () =>
["note", "empty_note"],
);
});
+
+test("keeps the data-grid table properties search on the shared column filter", () => {
+ const source = readFileSync("apps/desktop/src/components/grid/DataGrid.vue", "utf8");
+
+ assert.match(source, /filterObjectBrowserTableColumns\(props\.tableMeta\?\.columns \?\? \[\], searchQuery\.value\)/);
+});