Commit Graph

668 Commits

Author SHA1 Message Date
t8y2 a450405b0d perf(agent): reuse daemon process for test_connection to avoid JVM cold start
Keep a per-db-type daemon agent process alive in AgentManager. test_connection
now reuses the warm daemon instead of spawning a new JVM each time. If the
daemon dies, it auto-respawns on next call.
2026-05-13 05:08:55 +08:00
t8y2 bc687cee7f feat(agent): add reinstall JRE button in Driver Manager 2026-05-13 05:05:00 +08:00
t8y2 ff80e767d6 refactor: extract GITHUB_PROXIES constant shared by update and agent modules 2026-05-13 04:47:43 +08:00
t8y2 e85f9df1fe feat(agent): pluggable database drivers via JDBC agent subprocess
Migrate domestic database support (DaMeng, KingBase, Vastbase, GoldenDB) from
built-in ODBC/protocol drivers to standalone Java agent processes communicating
via stdin/stdout JSON-RPC 2.0. Agents are distributed as fat JARs with embedded
JDBC drivers, downloaded on-demand from GitHub Releases with proxy fallback.

- Add AgentDriverClient for subprocess lifecycle + JSON-RPC communication
- Add AgentManager for JRE/JAR install state management
- Add Tauri commands for driver install/uninstall/list
- Add DriverManager UI panel in settings dialog
- Extend DatabaseType with Kingbase, Vastbase, Goldendb variants
- Migrate Dameng from ODBC (dm_driver.rs) to JDBC agent
- Delete dm_driver.rs (343 lines)
- Add GitHub proxy fallback for downloads (update.hwdns.net, gh-proxy.org)

Agent code lives at https://github.com/t8y2/dbx-agents
2026-05-13 04:44:52 +08:00
t8y2 8ef1999ec9 fix(docs): restore root layout tags 2026-05-13 01:18:59 +08:00
t8y2 74ad4369f4 perf(ai): parallelize schema metadata loading for AI context
buildAiContext previously loaded table metadata sequentially in a
for-loop (3 API calls per table × up to 50 tables = 150 serial
round-trips). Now uses Promise.all to fetch all tables' columns,
indexes, and foreign keys concurrently, reducing total wait time
from O(n × latency) to O(latency).
2026-05-13 01:15:59 +08:00
t8y2 9ba2976d11 feat: export entire database as SQL file
Add a new "Export Database" feature accessible from the sidebar
right-click menu on database/schema nodes. Generates a .sql file
containing CREATE TABLE DDL, batched INSERT statements, and
view/procedure/function source code.

Backend (database_export.rs):
- Stream-writes SQL to file with configurable batch size
- Supports all SQL database types via existing DDL/INSERT generators
- Progress events with cancellation support
- Graceful error handling (continues on per-table failures)

Frontend (DatabaseExportDialog.vue):
- Connection/database/schema selector
- Checkboxes: structure, data, objects
- Real-time progress with current table and row count
- Cancel button

Wired up through Tauri commands, Web SSE routes, and API layer.
2026-05-13 01:08:16 +08:00
t8y2 83216b2765 feat(docs): 升级首页与更新日志 2026-05-13 01:04:58 +08:00
t8y2 965f529b77 feat(diff): selective sync, swap button, and execution progress
Schema Compare:
- Add checkbox per diff item for selective sync (with select-all)
- SQL preview now reactively updates based on checked items
- Add swap button to exchange source↔target
- Execute sync now runs statement-by-statement with progress indicator
- Show detailed error report for failed statements

Data Compare:
- Add swap button to exchange source↔target
- Execute sync now runs statement-by-statement with progress indicator
- Show error summary and per-statement failures
2026-05-13 00:15:48 +08:00
t8y2 004b5645c5 feat(grid): support multi-row Copy as INSERT
When multiple rows are selected, copyRowAsInsert now generates an
INSERT statement for each selected row instead of only the
right-clicked row.

Closes #166
2026-05-12 23:39:26 +08:00
t8y2 e1a07aae4a fix(grid): sync WHERE filter input to tab store on every keystroke
The previous fix (8032c63) only persisted whereInput when the user
triggered reload/paginate/sort. Typing a condition and switching tabs
without executing still lost it because the local ref was destroyed
on component unmount.

Emit update:whereInput on every change so ContentArea writes the
value to activeTab.whereInput immediately.

Fixes #232
2026-05-12 23:05:29 +08:00
t8y2 9483f0e440 fix(jdbc): rewrite JDBC URL for SSH/proxy tunnel in test_connection
test_connection passed the original config to the JDBC plugin without
rewriting the connection URL to use the tunneled localhost address.
Native drivers (PG, MySQL, etc.) used the already-substituted host/port,
but the JDBC path bypassed this, so the plugin tried to connect directly
to the remote host — failing when only reachable through the tunnel.

Apply the same rewrite_jdbc_url_host logic used in get_or_create_pool.

Fixes #230
2026-05-12 19:01:11 +08:00
t8y2 726e144c4c fix(oracle): update rust-oracle to fix bit vector loss in query path
Fixes #228
2026-05-12 18:46:02 +08:00
t8y2 ee0b2312da fix(sidebar): sort search results by match score
Exact and prefix matches now rank above substring and fuzzy matches
so searching for e.g. "core_flow" puts the exact table at the top
instead of burying it behind partial hits.
2026-05-12 18:02:47 +08:00
t8y2 908f2cfaa5 feat(sidebar): show tooltip on truncated names and enable horizontal scroll (closes #231)
Add a shadcn-vue Tooltip to tree nodes that only activates when the
label text is truncated. Enable horizontal scrolling on the sidebar
tree container for deeply nested long names.
2026-05-12 17:57:44 +08:00
t8y2 1380cfe04e feat(toolbar): add Compare Databases and Compare Data buttons
Expose Schema Diff and Data Compare dialogs from the top toolbar
so they can be opened without pre-selecting a connection in the
sidebar. Connections are chosen inside the dialog.
2026-05-12 17:38:13 +08:00
t8y2 bf58045a28 Revert "feat(cli): add dbx-cli runtime and agent integration (#229)"
This reverts commit 58c47adef5, reversing
changes made to 3bcec8ef7f.
2026-05-12 17:31:54 +08:00
skyler 58c47adef5
feat(cli): add dbx-cli runtime and agent integration (#229)
Feature/dbx cli runtime
2026-05-12 17:22:36 +08:00
t8y2 3bcec8ef7f feat(grid): highlight active row and add first/last page buttons
- Highlight the row containing the selected cell with a subtle
  primary-color tint so the active row is easy to spot.
- Add first-page (« ) and last-page (») pagination buttons.
  Last-page runs a COUNT(*) query to calculate the final page offset.
2026-05-12 17:16:37 +08:00
t8y2 4f48ddc823 feat(grid): add first-page and last-page pagination buttons
Add « and » buttons to the pagination bar. First-page jumps to page 1.
Last-page runs a COUNT(*) query to calculate total pages, then jumps
to the final page.
2026-05-12 17:09:20 +08:00
Illuminated2020 ef83cedfb4 fix: adapt cli runtime branch after rebase 2026-05-12 17:04:18 +08:00
t8y2 62a79ab611 fix(grid): exclude columns with defaults from NOT NULL validation
The save validator rejected NULL in NOT NULL columns even when the
column has a DEFAULT (e.g. serial/sequence). Skip those columns so
cloned rows with auto-increment PKs pass frontend validation.
2026-05-12 17:00:42 +08:00
Illuminated2020 dd3894df68 style(agent-runtime): 格式化运行时风险辅助函数 2026-05-12 16:52:35 +08:00
Illuminated2020 636f4ee055 fix(agent-runtime): 修正 handoff 风险重算连接来源 2026-05-12 16:52:35 +08:00
Illuminated2020 bb2e39d2f5 fix(runtime): 加固 handoff 风险重算与 URL 脱敏
- GUI runtime 接收 handoff 后基于 SQL 与可用连接元数据重算风险
- CLI conn list/show 清洗敏感 query 参数并补充回归测试
2026-05-12 16:52:35 +08:00
Illuminated2020 2fd3e533e9 fix(dbx-cli): 修复空存储下 context 回退
- 在 GUI runtime 不可用且 headless storage 无法打开时返回空上下文

- 增加空 app data 与不可打开 app data 的 dbx-cli 回归测试
2026-05-12 16:52:35 +08:00
Illuminated2020 37cde903d5 test(cli): 补强 runtime discovery 验证 2026-05-12 16:52:35 +08:00
Illuminated2020 af2d874883 fix: harden handoff status transitions 2026-05-12 16:52:35 +08:00
Illuminated2020 780311a542 feat(agent-runtime): 接入 handoff 审阅状态
- 支持 handoff queued/shown 状态加载、mark shown 和 reject 持久化

- 为 Tauri/API/Pinia store 接入 handoff 审阅状态流转

- 新增 AgentHandoffDialog 审阅 UI,拒绝操作不执行 SQL
2026-05-12 16:52:34 +08:00
Illuminated2020 6518061008 fix(agent-runtime): 启动恢复后同步运行时快照 2026-05-12 16:52:34 +08:00
Illuminated2020 c144330d79 feat(runtime): 同步前端状态到 agent runtime
- 新增 snapshot 构造 helper 和 agent runtime store

- 同步 active tab、连接、库、schema、SQL、选中 SQL、表格选择和结果采样

- 补充 snapshot payload 组装测试
2026-05-12 16:51:34 +08:00
Illuminated2020 feff43c459 style: 恢复 hook 后 Rust 格式化 2026-05-12 16:49:29 +08:00
Illuminated2020 5b62f936d1 style: 应用 Rust 格式化 2026-05-12 16:49:29 +08:00
Illuminated2020 67a7ef4746 fix(agent-runtime): 修复运行时 HTTP 读取与发现文件写入 2026-05-12 16:49:29 +08:00
Illuminated2020 9425658ecd feat(agent-runtime): 新增 Tauri agent runtime 服务
- 启动独立 localhost server 并写入 owner-only discovery

- 提供 token 认证的 context、selection、result 和 handoff 端点

- 接入 Tauri 启动、invoke 命令和退出清理

- 补充认证、路由、discovery 权限与 symlink 防护测试
2026-05-12 16:49:29 +08:00
Illuminated2020 8a81bdfdd5 feat(core): 支持 MySQL 和 Postgres 查询行数限制
- 新增 MySQL/Postgres limit-aware 查询执行函数

- 保持旧执行 API 默认转调 MAX_ROWS

- 让 query.rs 对 MySQL/Postgres 传递 row_limit

- 补充 limit-aware 驱动调用回归测试
2026-05-12 16:49:29 +08:00
Illuminated2020 4267c6f1e0 style: 应用 CLI 相关 Rust 格式化 2026-05-12 16:49:29 +08:00
Illuminated2020 2c3704a365 fix(query): 统一执行入口结果行数截断
- 在 execute_sql_statement_with_row_limit 成功返回前统一应用 row_limit

- 补充 truncate_result_with_row_limit 的截断、保留和零值限制单测
2026-05-12 16:49:29 +08:00
Illuminated2020 2f23df9675 fix(cli): 修复 headless 查询安全与 limit 下推
- 对 schema snapshot 和 safe-query 的内部失败使用安全错误映射

- 为 SQLite/DuckDB 嵌入式连接展开 tilde 路径

- 新增 limit-aware 查询执行接口并让 safe-query 传入读取上限

- 补充 SQLite 大结果集、错误清洗和 tilde 路径回归测试
2026-05-12 16:49:28 +08:00
Illuminated2020 7486e2c7b3 feat(dbx-cli): 实现 headless schema 与 safe-query
- 调用 dbx_core::schema_snapshot 生成 headless schema snapshot

- safe-query 从 storage 加载连接并按风险阻断非 READ SQL

- 补充 SQLite fixture 覆盖 READ、limit 与阻断错误
2026-05-12 16:47:40 +08:00
Illuminated2020 4c84cd0559 fix(cli): 修复连接展示的匹配与脱敏
- 优先按唯一连接 ID 命中 conn show,避免被同名连接歧义阻断

- headless context 不再输出绝对 dbx.db 路径

- 脱敏 SQLite 和 DuckDB redactedUrl 中的本地文件路径
2026-05-12 16:47:40 +08:00
Illuminated2020 9b6d058cd5 feat(dbx-cli): 实现 headless 连接读取
- 从 DBX Storage 读取 context、conn list 和 conn show 的连接配置

- 输出脱敏连接 DTO 与风险元数据,避免泄露密码和 SSH secret

- 覆盖连接不存在、名称歧义和 fixture 存储读取测试
2026-05-12 16:47:40 +08:00
Illuminated2020 dc13dd3376 fix(cli): 修复命令参数解析
- 允许自由文本选项值以双短横开头

- 支持全局 --format json 出现在命令前、中、后

- 拒绝各命令多余位置参数并补充回归测试
2026-05-12 16:47:40 +08:00
Illuminated2020 37eeb8999c fix(dbx-cli): 加固运行时命令参数校验
- 严格校验未知 flag、缺失 option 值和 result current limit 范围

- 支持 handoff 的 SQL 来源校验及 headless 队列落盘

- 校验 runtime discovery 文件的 symlink、owner 和权限
2026-05-12 16:47:40 +08:00
Illuminated2020 f48868006c feat(dbx-cli): 增加 runtime discovery 与命令分发
- 增加 dbx-cli 参数解析与 8 个命令入口

- 实现 runtime discovery client 与 headless fallback

- 更新 CLI 依赖和锁文件

- 纳入 cli/storage 的格式化 diff
2026-05-12 16:47:40 +08:00
Illuminated2020 93f99039f1 fix(schema_snapshot): 修复快照表视图归一与错误传播
- 移除独立 views 字段,统一通过 tables 返回表和视图

- 为逐表元数据采集增加受限并发 helper

- 传播 schema core 错误并补充上下文信息

- 对缺少必需 database 的连接返回明确错误

- 补充 SQLite 视图、错误传播和无 database 场景单测
2026-05-12 16:47:40 +08:00
Illuminated2020 78be118c58 feat(schema): 添加 schema snapshot 编排
- 新增 schema snapshot DTO,标准化连接、数据库、driver 和采集时间信息

- 复用现有 schema core 函数采集表、视图、列、索引、外键和触发器

- 添加 SQLite 集成测试覆盖表/视图与元数据快照输出
2026-05-12 16:47:40 +08:00
Illuminated2020 037e082104 feat(handoff): 增加连接 ID 和稳定排序
- 为 HandoffItem 增加 connection_id,并保留 connection_name 用于展示

- 为 handoffs 增加自增 seq 并迁移旧表结构

- load_pending_handoffs 按 created_at 与 seq 稳定 FIFO 排序

- 补充同 created_at FIFO、seq 结构与 connectionId 序列化测试
2026-05-12 16:47:40 +08:00
Illuminated2020 72690f6ebf feat(core): 增加 handoff 队列存储模型
- 新增 handoff 状态与队列项 DTO

- 为 Storage 增加 handoffs 表和 pending 读写方法

- 补充 handoff 队列保存、排序和状态过滤单测
2026-05-12 16:46:53 +08:00
t8y2 90e32ec683 fix(grid): skip null columns in INSERT so database defaults apply
When cloning or adding a row, null columns (e.g. auto-increment PKs)
were explicitly inserted as NULL, violating NOT NULL constraints.
Omit them so the database DEFAULT (sequence, now(), etc.) kicks in.
2026-05-12 16:45:53 +08:00