Files
dbx/apps/desktop/src/lib
二丫讲梵 930aa48c20 feat(grid): 新增原始数据复制模式并设为默认
* ✨ feat(grid): 新增原始数据复制模式并设为默认

- 原样输出单元格内容,不对引号、制表符和换行进行 DSV 转义
- 支持原始数据复制后的网格粘贴还原
- 补充多语言复制选项文案及前后端提取器实现与测试

* ✨ feat(grid): 优化新增智能复制选项

- 单个单元格复制保留原始单元格文本,多单元格自动使用转义 TSV
- 默认复制设置由格式选择升级为复制行为选择,并支持预览
- 限制原始文本格式仅用于单单元格复制
- 更新多语言文案及相关测试
2026-08-05 23:58:01 +08:00
..

Desktop Library Layout

src/lib is organized by product/runtime domain. Keep implementation modules inside a domain folder instead of adding new files at the root.

  • backend: Tauri, HTTP, platform, storage, and transport bridges.
  • common: generic helpers with no DBX feature ownership.
  • app, tabs, sidebar, connection: shell, navigation, and connection UI state helpers.
  • database, metadata, schema, table: relational database metadata, capabilities, DDL, and table-object helpers.
  • sql, sql/semantic, editor, query, history, savedSql: SQL editing, execution, diagnostics, history, and saved SQL behavior. Keep fixed SQL completion statements and their database-specific variants in sql/sqlSnippetTemplates.ts; cross-check row-limiting families against crates/dbx-core/src/sql_dialect/capabilities.rs and authoritative dialect documentation, and never replace a user-customized built-in body with a generated default.
  • dataGrid: result/grid rendering, editing, previews, pagination, and export helpers tied to the grid.
  • ai, mcp: AI assistant and MCP configuration helpers.
  • redis, mongo, elasticsearch, etcd, kv, mq, nacos, zookeeper, webdav: non-relational or service-specific helpers.
  • diagram, document, export, imports: feature-specific utilities that are shared by more than one component.

Tests under src/lib/__tests__ mirror the same domain folders. When moving a module, update both runtime imports and colocated tests so stale root-level aliases do not return.

Schema Diff Metadata Guardrails

Schema comparison must filter disabled object types before loading metadata. Tables load columns and the relational metadata enabled by the compare options; views load DDL only.

Do not call column, index, foreign-key, or trigger metadata APIs for views. MySQL 5.7 can validate a SQL SECURITY DEFINER view during column discovery and return error 1143 when its definer account no longer exists, even though SHOW CREATE VIEW still succeeds. Keep view detection centralized in schema/schemaDiffTableFilter.ts and preserve the DDL-only plan in schema/schemaDiffMetadataLoad.ts.

Regression coverage belongs in:

  • src/lib/__tests__/schema/schemaDiffTableFilter.spec.ts
  • src/lib/__tests__/schema/schemaDiffMetadataLoad.spec.ts