Commit Graph
1366 Commits
Author SHA1 Message Date
t8y2 f88367a872 feat: add OpenGauss support and enhance MySQL URL parameter handling 2026-05-30 00:31:29 +08:00
t8y2 8e31e97bbe fix(opengauss): update jsonb-compatible postgres driver 2026-05-30 00:03:39 +08:00
t8y2 b6ac1f177b refactor(agent): consolidate driver architecture 2026-05-29 23:29:27 +08:00
t8y2 cd87d2a4e4 fix: normalize MySQL SSL mode URL params 2026-05-29 20:22:31 +08:00
t8y2 c71804d144 feat: add InterSystems IRIS database support
Add IRIS as a new agent-driven database type with:
- iris:// connection URL scheme (default port 1972, user _SYSTEM)
- JDBC driver via agent (com.intersystems.jdbc.IRISDriver)
- Oracle-compatible DDL dialect and schema-aware SQL dialect
- Capability sets: schema-aware, tree schema, diagram, search, table structure

Closes #368
2026-05-29 19:15:11 +08:00
t8y2 48a8810070 fix: stop remapping bigint to int8 in grid column type display
MySQL users expect "bigint" not PostgreSQL's internal "int8". Removing
this mapping keeps the SQL-standard name visible for both databases.
2026-05-29 18:17:15 +08:00
t8y2 b07273249b chore: cargo fmt with rustc 1.96 to fix CI format check 2026-05-29 18:15:15 +08:00
t8y2 ba9dad7f7b chore: remove brittle source-code regex-matching tests
These 81 test files used readFileSync to check source code for regex
patterns. They broke on any formatting change or minor refactor and
provided no behavioral coverage. 641 real unit tests remain.
2026-05-29 18:05:12 +08:00
t8y2 5d91efd690 feat: merge OceanBase picker entries into one with MySQL/Oracle mode toggle
Replace two separate "OceanBase" and "OceanBase Oracle Mode" entries in the
database picker with a single "OceanBase" entry. After selecting, users can
switch between MySQL and Oracle modes via button toggles in the config form.
2026-05-29 17:59:14 +08:00
t8y2 58f2942520 feat: generalize URL params field to all database types and support oceanbase-oracle URL params
Remove the hardcoded 12-type whitelist for the URL params form field so all
database types (including agent-driven ones like oceanbase-oracle) can set
custom URL parameters. Also append url_params to oceanbase-oracle connection
URLs in the Rust backend (matching the existing Postgres/Redshift pattern).
2026-05-29 17:56:03 +08:00
t8y2 ef4baba57a feat: support double-clicking .db/.sqlite/.duckdb files to open in IDE
Add OS file association for database files (.db, .sqlite, .sqlite3, .duckdb)
so double-clicking them in Finder/Explorer automatically creates a connection.
If the same file path is already connected, prompts the user to switch instead.

Also fix 42 pre-existing clippy warnings in dbx-core (needless_borrow,
too_many_arguments, derivable_impls, manual_div_ceil, type_complexity, etc.).

Closes #527
2026-05-29 17:25:52 +08:00
t8y2 bbdb21c1e6 fix: strip JDBC-only MySQL URL parameters before driver parsing
JDBC connection URLs contain MySQL Connector/J-specific parameters
(useUnicode, characterEncoding, zeroDateTimeBehavior, useSSL,
serverTimezone, etc.) that mysql_async::Opts::from_url() does not
recognize, causing "Invalid MySQL URL: Unknown connection URL
parameter" errors. Filter these parameters out in mysql_async_url()
before passing the URL to the driver.

Fixes #524
2026-05-29 16:48:54 +08:00
t8y2 f8215f7347 fix: open changelog links in external browser instead of in-app
Clicking links in the update dialog release notes was navigating within
the Tauri webview with no way to go back, requiring a restart. Now link
clicks are intercepted and opened externally via @tauri-apps/plugin-shell
or window.open.

Closes #525
2026-05-29 16:39:31 +08:00
t8y2 8a3bd067a2 fix: independent column width resizing in transpose view
Replace shared transposeRecordWidth with per-record width array so dragging a resize handle only affects that column. New columns auto-calculate optimal initial width based on content.
2026-05-29 16:35:29 +08:00
t8y2 027c39a610 perf: optimize database connection pooling and query execution
- Increase MySQL pool max from 1 to 3 to avoid contention across tabs
- Merge get_columns serial queries into a single LEFT JOIN
- Clone pool handles before health checks in refresh_connections to reduce lock contention
- Skip COUNT(*) when result rows are fewer than the page size
2026-05-29 16:26:19 +08:00
t8y2 4fd8d895f4 fix: cargo fmt formatting in dbx-web main.rs 2026-05-29 15:46:32 +08:00
t8y2 76585b2e28 fix: use recursive findNode in disconnect to handle connections inside groups 2026-05-29 15:40:22 +08:00
t8y2 4cf179f0c0 style: cargo fmt 格式化修复 2026-05-29 15:13:07 +08:00
t8y2 b54eda1889 fix: 修复应用长时间挂后台后恢复时表格数据永久加载的问题
三层防护:
- MySQL 连接获取时执行 ping 健康检查,死连接自动重连
- macOS Reopen 事件 + 前端 visibilitychange 触发连接刷新
- 前端 Promise.race 超时保护,确保 loading 状态不会超过 60s
2026-05-29 15:12:14 +08:00
t8y2 6c0db6f517 feat: add "Copy as SQL ALTER" to DataGrid column header context menu
Right-click a column header in the data grid to copy the ALTER TABLE
statement for that column, making it easy to replicate column definitions
across databases. Supports all major dialects (MySQL, Postgres, SQL Server,
Oracle, ClickHouse, SQLite, DuckDB, H2).

Closes #516
2026-05-29 15:09:10 +08:00
rarnu 51e62d4c60 SSH 隧道连接优化 (#517)
* 1. 增加 SSH 隧道保活
每 30 秒发一次 keepalive 包,防止 NAT/防火墙丢弃空闲连接。

2. SSH 隧道自动重连
整体逻辑为:
  └─ 初始连接(失败则立即报错,防止 credential 错误时无限重试)
  └─ 绑定 TcpListener(端口不变)
  └─ 启动 tunnel_reconnect_loop
      ├─ forward_loop()  ← 转发数据,检测到 session 断开后退出
      ├─ 睡眠 5 秒
      ├─ connect_and_authenticate() 重连
      ├─ 重连失败?→ 继续等 5 秒 → 重试
      └─ 重连成功 → 回到 forward_loop()

* 修复rust代码风格

* 1:指数退避
延迟序列: 5s → 10s → 20s → 40s → 60s → 60s → ...(封顶 60s)
不再是固定 5 秒重试,避免临时故障时刷屏。

2:最大重试次数
连续失败 10 次后放弃,打一条 fatal 日志 max reconnect attempts exhausted, giving up,然后隧道任务退出。不再无限循环。

3:日志改进
失败日志现在带进度:SSH reconnect failed (host:port, attempt 3/10): error
成功重连日志也带 (attempt N) 方便排查。
2026-05-29 13:31:31 +08:00
3991ce2a90 Fix/issue 515 UI scale settings dialog (#520)
* feat(structure): auto-switch column length default based on data type

When changing a column's data type in the table structure editor, the
length parameter now updates to a sensible default for the new type
(e.g. int→11, tinyint→4) instead of preserving the old value.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(editor): preserve scroll position after SQL execution

After DDL/DML execution via the danger confirmation dialog, the editor
scrolls to the top, making it hard to locate the executed statement.
Fix by scrolling the cursor back into view after execution completes,
using nextTick + requestAnimationFrame to wait for Splitpanes layout
stabilization.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(settings): 修复大比例 UI 缩放下设置弹窗无法操作的问题

设置弹窗主体区域设置了固定最小高度 sm:min-h-[520px]。当全局 UI 缩放
调到很大(如 200%)时,webview 的 CSS 视口大幅缩小,外层 DialogContent
高度被 calc(100vh-80px) 限制到比 520px 更小,主体区域被强行撑到 520px,
溢出部分被 overflow-hidden 裁掉,导致底部页脚(应用/保存按钮)被裁出可视
区且没有滚动条,用户无法把缩放改回来。

移除该固定最小高度,让主体区域随视口收缩,内部 overflow-y-auto 接管滚动,
带 shrink-0 的页脚在任意缩放比例下始终可见。大屏无回归:DialogContent
仍保持 min(660px, ...) 的固定高度。

Fixes #515

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: t8y2 <1156263951@qq.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 12:31:05 +08:00
Abeautifulsnow 310cc22b37 Fix/disable table comment for unsupported db (#518)
* fix(structure-editor): disable table comment input for databases that don't support comments (e.g. SQLite)

## 背景说明
SQLite 不支持表注释(COMMENT),但表注释输入框始终可编辑。用户修改注释后,SQL 预览显示暂无变更且应用变更按钮不可用,造成困惑的 UX。

## 修改内容
- 新增 isTableCommentDisabled 计算属性,基于 structureCapabilities.comment 控制禁用状态
- 表注释 Input 添加 :disabled 绑定,禁用时输入框变灰不可编辑
- 禁用时在输入框右侧显示 Info 图标,hover 显示 Tooltip 说明
- 三语言(zh-CN / en / es)新增 tableCommentUnsupported 翻译

## 影响范围
- SQLite、DuckDB 及未知数据库类型:输入框被禁用 + Tooltip 提示
- MySQL、PostgreSQL、ClickHouse 等支持注释的数据库:完全不受影响
- 后端 generate_comment_ddl 已有对等过滤(仅 Postgres/Oracle/ClickHouse 生成 COMMENT SQL)

## 测试
- 建议补充:dbType 为 sqlite 时 isTableCommentDisabled 为 true 的单元测试

* test(structure-editor): add tests for table comment disabled state and unsupported DB capabilities
2026-05-29 12:29:50 +08:00
github-actions[bot] 5e6d94afff chore(jdbc): bump plugin version [skip ci] 2026-05-28 18:03:46 +00:00
t8y2 521195c801 chore(release): v0.5.24 v0.5.24 2026-05-29 02:03:18 +08:00
t8y2 6628ea39da fix(build): enable full link-time optimization in release profile 2026-05-29 01:58:56 +08:00
t8y2 06c87676a0 fix(desktop): bundle Geist font locally for offline startup 2026-05-29 01:57:03 +08:00
t8y2 e2aad8a1d8 fix(windows): refresh app and tray icons 2026-05-29 01:34:58 +08:00
t8y2 eaff976de7 fix(connection): retry metadata loads after idle disconnect 2026-05-29 01:22:08 +08:00
t8y2 660ba07264 feat(sidebar): add compact object display mode 2026-05-29 01:17:46 +08:00
t8y2 c8310e61c9 fix(desktop): avoid blank screen on startup 2026-05-29 00:56:42 +08:00
t8y2 2e431d6e33 feat(transfer): improve postgres cross-version migration 2026-05-29 00:49:29 +08:00
t8y2 e2959420fc fix: use cargo fmt instead of bare rustfmt in pre-commit hook
裸 rustfmt 不会读取 rustfmt.toml 配置,改用 cargo fmt --manifest-path
确保提交时格式化行为与手动 cargo fmt 一致。
2026-05-29 00:43:17 +08:00
t8y2 c7b7bed140 feat(editor): add extended column properties support for MySQL, PostgreSQL, and SQL Server
MySQL: AUTO_INCREMENT, ON UPDATE CURRENT_TIMESTAMP
PostgreSQL: GENERATED AS IDENTITY (BY DEFAULT / ALWAYS)
SQL Server: IDENTITY(seed, increment)
2026-05-29 00:41:51 +08:00
t8y2 ab12ab5c11 feat(editor): add keyboard navigation to type selector and column resize to structure editor
- SearchableSelect: support ArrowUp/Down to navigate filtered options, Enter to select, Escape to dismiss
- TableStructureEditor: add drag-to-resize column widths and horizontal scrolling for the columns table
2026-05-29 00:22:08 +08:00
t8y2 a1e00fcf1a fix: release duckdb session locks on pool close 2026-05-29 00:16:37 +08:00
t8y2 f8ade78e97 fix(jdbc): enable Oracle metadata path for Dameng column comments
Dameng JDBC driver does not populate the REMARKS field from
DatabaseMetaData.getColumns(). Instead, map jdbc:dm: URLs to ORACLE_QUIRKS
so column comments are retrieved via all_col_comments system view, matching
how Oracle connections are handled.

Fixes #504
2026-05-28 23:46:11 +08:00
t8y2 1d2fec4aee perf(editor): optimize SQL autocomplete responsiveness
- Add 150ms debounce on async completion path to reduce redundant Tauri IPC calls during rapid typing
- Parallelize schema table fetching with max concurrency of 5
- Separate schema list cache from table completion cache for longer-lived reuse
- Return keyword completions synchronously when no backend data is needed
- Lower snippet base boost for label-only matches so keywords rank above snippets when user types past snippet prefix
2026-05-28 23:31:31 +08:00
t8y2 39b960c46c fix(mysql): select database during URL connection setup 2026-05-28 23:02:44 +08:00
t8y2 539faef23d feat(query): display total row count in result status bar
Execute COUNT query asynchronously after main query to show total
matching rows. Strip user-supplied LIMIT/OFFSET from count SQL so
the total reflects all rows, not just the limited page.
2026-05-28 22:44:13 +08:00
t8y2 e15e99aeb5 fix(ci): make Emitter import unconditional and update defineExpose test regex
- Move Emitter import out of macos-only cfg so emit() works on Linux
- Update test regex to include scrollCursorIntoView in defineExpose
2026-05-28 22:09:54 +08:00
skyler 18e5ee35bb Merge pull request #505 from Michaelxwb/feature_mongo
feat(mongodb): 支持聚合查询、批量写入和 MCP 集成
2026-05-28 21:42:47 +08:00
t8y2 025b465bf1 fix(editor): preserve scroll position after SQL execution
After DDL/DML execution via the danger confirmation dialog, the editor
scrolls to the top, making it hard to locate the executed statement.
Fix by scrolling the cursor back into view after execution completes,
using nextTick + requestAnimationFrame to wait for Splitpanes layout
stabilization.
2026-05-28 21:36:29 +08:00
t8y2 9aae48d089 feat(structure): auto-switch column length default based on data type
When changing a column's data type in the table structure editor, the
length parameter now updates to a sensible default for the new type
(e.g. int→11, tinyint→4) instead of preserving the old value.
2026-05-28 21:36:28 +08:00
徐文彬 5ea146e08e fix(mongodb): guard aggregate execution paths 2026-05-28 21:29:08 +08:00
徐文彬andClaude Opus 4.7 c56bcb8e2d feat(mongodb): 支持聚合查询、批量写入和 MCP 集成
- 桌面端:解析 db.<集合>.aggregate([...]) shell 语法,新增 mongoAggregateDocuments
  接口(Tauri + HTTP);mongo 入口统一补 ensureConnected;ObjectId(...) 自动
  转换为 {"\$oid":"..."} 扩展 JSON 表示。
- dbx-core:新增 aggregate_documents、insert/update/delete_documents bulk
  操作;扩展 JSON 解析识别 \$oid;schema list_tables_core 补 MongoDB/Elasticsearch
  分支返回 COLLECTION/INDEX。
- dbx-web / Tauri 命令 / MCP bridge:注册 4 个新 mongo 路由
  (aggregate/insert/update/delete documents);MCP bridge 新增 mongo HTTP 入口
  和 lazy 连接复用。
- node-core (MCP 后端):mongodb 走专属 executeQuery / listTables /
  describeTable;read-only 默认 + DBX_MCP_ALLOW_WRITES /
  DBX_MCP_ALLOW_DANGEROUS_SQL 两级开关;aggregate 含 \$out/\$merge 走同样开关;
  describeTable 抽样 20 条文档推断字段类型,_id 自动标记主键。
- mcp-server:mongodb 跳过 SQL safety evaluator(mongo shell 与 SQL 语法
  不兼容),改由 backend 做命令级 gating;附注释。
- AiAssistant 同时 emit replaceSql + executeSql 让编辑器和结果保持一致;
  App.vue ensureQueryTab 在无上下文时回退到连接默认库;aiMessageRender
  识别 mongodb / mongo 代码块。
- Review 修复:合并两份重复的 evaluateMongo*Safety 实现(同时修复 web-backend
  用字符串比较导致空 filter 检查可被空格绕过的 bug);ObjectId 正则兼容
  单/双引号;mongo_ops 错误文案 "MCP" 改为 "bulk";补 aggregate 解析测试用例。

测试:pnpm test 911 通过;vue-tsc 通过;cargo check -p dbx-core 通过。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 21:25:43 +08:00
t8y2 c943bf4179 feat(sidebar): hide SQL library node when no saved SQL files exist 2026-05-28 21:17:24 +08:00
t8y2 d57660eba9 fix(grid): freeze row number column on horizontal scroll 2026-05-28 20:47:47 +08:00
t8y2 f45ee8f272 feat(settings): keep dialog open after apply 2026-05-28 20:36:56 +08:00
t8y2 fcdc7cfc07 fix(rust): update mtls tests for timeout params 2026-05-28 20:35:15 +08:00