Commit Graph

145 Commits

Author SHA1 Message Date
t8y2 70becfd74f fix: split screenshot field from log field in issue templates
render: shell blocks image paste/drag — separate into a plain textarea
so users can attach screenshots directly.
2026-05-13 15:26:22 +08:00
t8y2 20d1fa724d fix: make AI stream cancel respond instantly via tokio::select
Replace AtomicBool polling (only checked between chunks) with
tokio::sync::Notify + tokio::select!, so the stop button takes
effect immediately even when the LLM is thinking.
2026-05-13 14:59:55 +08:00
t8y2 6be7170dfb fix: add Windows launcher for JDBC plugin (os error 193) 2026-05-13 14:27:47 +08:00
t8y2 fa0dfc9383 perf: race GitHub proxies concurrently for driver downloads and registry fetch
Replace sequential proxy fallback (up to 30s worst-case) with concurrent
racing via futures::select_ok, returning the first successful response.
Add list_installed_agents_local command for instant UI rendering with
async registry update. Fix missing useToast import in RedisValueViewer.
2026-05-13 14:18:28 +08:00
t8y2 321ebc2636 fix: support HTTPS and self-signed certs for Elasticsearch connections
ES 8.x enables HTTPS with self-signed certs by default. When SSL is
toggled on, use https:// scheme and accept invalid certificates.

Closes #234
2026-05-13 14:07:01 +08:00
t8y2 e87876c923 feat(driver-store): badge-style version/size, refresh button, fix dameng icon
- Show version and size as rounded badges instead of plain text
- Display remote version with amber badge when update available
- Add refresh button to clear registry cache and reload
- Add invalidate_agent_registry_cache Tauri command
- Fix dameng icon mapping (dameng -> dm)
2026-05-13 12:26:56 +08:00
t8y2 047e8fc2f1 fix: filter SQL completion tables 2026-05-13 11:01:59 +08:00
t8y2 7ce2cf2163 feat: add 12 new agent-driven databases, migrate GaussDB to agent
Add H2, Snowflake, Trino, Hive, DB2, Informix, Neo4j, Cassandra,
BigQuery, Apache Kylin, SunDB as new agent-driven database types.
Migrate GaussDB from native rust-gaussdb to JDBC agent.

Remove rust-gaussdb dependency. Total agent-driven databases: 17.
2026-05-13 09:47:22 +08:00
t8y2 c50323cd6c feat(agent): migrate Oracle to JDBC agent, add install progress bar and toast
- Migrate Oracle from rust-oracle to JDBC agent (ojdbc11)
- Delete oracle_driver.rs (567 lines) and rust-oracle dependency
- Add streaming download progress bar for driver/JRE installation
- Add toast notifications for install/uninstall success/failure
- Add "update available" badge in driver manager
2026-05-13 09:20:06 +08:00
t8y2 831883f156 perf(agent): use single execute_transaction RPC for batch commits 2026-05-13 05:34:01 +08:00
t8y2 26245514bb refactor: remove ODBC dependency entirely
DaMeng now uses JDBC agent instead of ODBC. Remove odbc-api crate,
ODBC_ENV static, unixodbc system dependency from CI, and ODBC library
bundling from macOS release builds. macOS no longer needs any brew
dependencies for development.
2026-05-13 05:27:56 +08:00
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 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 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 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
Illuminated2020 ef83cedfb4 fix: adapt cli runtime branch after rebase 2026-05-12 17:04:18 +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 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 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
Illuminated2020 81a6dce5ac fix(sql_safety): 修复 CTE 兄弟片段边界误判
- CTE 内 DELETE/UPDATE 离开当前片段后停止查找 WHERE/LIMIT

- 补充 sibling CTE WHERE/LIMIT 不应降低风险等级的回归测试
2026-05-12 16:45:31 +08:00
Illuminated2020 99e7997620 fix(sql_safety): 修正子查询边界误判 2026-05-12 16:45:30 +08:00
Illuminated2020 1909856467 fix(sql-safety): 修复 SQL 风险复审问题
- 调整环境标签优先级,并阻止显式非生产标签回退

- 将无 WHERE/LIMIT 的 DELETE/UPDATE 标记为 critical

- 跳过 PostgreSQL dollar quote,扫描 MySQL executable comment

- 补充 sql_safety 覆盖测试
2026-05-12 16:45:30 +08:00
Illuminated2020 99e5e6317d fix(sql-safety): 修正危险 SQL 分类与风险上下文
- 扫描可执行 SQL token,避免 WITH、EXPLAIN ANALYZE 和多语句中的写入/DDL 被判为 Read
- 引入 RiskContext 支持 environment_label,并保留 risk_for_connection 便捷调用
- 补充 SQL 安全分类与生产环境风险识别测试

BREAKING CHANGE: risk_for 现在接收 RiskContext;三参数便捷调用迁移为 risk_for_connection
2026-05-12 16:45:30 +08:00
Illuminated2020 bc6898cd22 feat(dbx-core): 新增 SQL 安全风险分类
- 添加 sql_safety 模块,区分 READ、WRITE、DDL 和 Unknown

- 增加生产连接信号识别和风险元数据输出

- 导出模块并补充分类器单元测试
2026-05-12 16:45:30 +08:00
Illuminated2020 7f83739040 fix(cli): 校验 CLI envelope 反序列化
- 为 CliEnvelope 增加 ok/data/error 一致性校验和回归测试

- 让 dbx-cli commands 复用 dbx-core 的 CLI DTO 与 helper
2026-05-12 16:45:30 +08:00
Illuminated2020 10373bdf36 feat(dbx-core): 新增 CLI envelope DTO
- 添加 CLI source、error code、error 和 envelope 类型

- 导出 dbx-core::cli 模块并补充序列化单元测试

- 补齐既有测试 fixture 的 JDBC 默认字段以恢复目标测试编译
2026-05-12 16:45:30 +08:00
Illuminated2020 dd113ed714 build(dbx-cli): 将 CLI 二进制改名为 dbx-cli
- 更新 dbx-cli crate 的 bin 目标名,避免与桌面 dbx 目标冲突

- 同步计划文档中的 cargo run 命令引用

- 保留 runtime_client.rs 现有格式化改动
2026-05-12 16:43:46 +08:00
Illuminated2020 01110945a1 fix(dbx-cli): 补齐最小 runtime client 模块以恢复编译
- 新增 commands 和 runtime_client 最小实现,补足 main.rs 所需模块

- 允许 context 读取 GUI runtime,GUI 专属命令在 headless 下返回结构化错误

- 更新 Cargo.lock 并确认 cargo check -p dbx-cli --locked 通过
2026-05-12 16:43:46 +08:00
Illuminated2020 5720f05dd0 feat(cli): 添加 CLI crate 骨架 2026-05-12 16:43:46 +08:00
t8y2 24ab55ed17 fix(sqlserver): preserve batch semantics for CTE and DECLARE statements
SQL Server treats `;` as a statement terminator, not a batch separator.
The previous logic split multi-statement SQL by `;` and executed each
independently, breaking variable/CTE scope across statements.

Send the entire SQL as a single batch via `simple_query` so DECLARE,
SET, and CTE definitions remain visible to subsequent statements.
Split only on the `GO` client directive when present.
2026-05-12 16:22:22 +08:00