Commit Graph

52 Commits

Author SHA1 Message Date
github-actions[bot] 89a48b9726 chore(packages): release 0.4.11 [skip node-packages-release] 2026-06-18 16:18:52 +00:00
t8y2 26cc2fdc4c fix: pass numeric precision/scale fields through bridge column mapping 2026-06-18 00:48:59 +08:00
t8y2 00541291e3 feat(ssh): support custom SSH agent socket path 2026-06-18 00:15:08 +08:00
xcstatus 417a48ccfe
fix(mcp): route ssh transport layers through desktop bridge 2026-06-17 22:06:33 +08:00
github-actions[bot] a8632fbab2 chore(packages): release 0.4.10 [skip node-packages-release] 2026-06-16 04:13:51 +00:00
t8y2 000c236619 feat(connection): add keepalive interval 2026-06-16 10:23:49 +08:00
John Jin 1afc271c18
feat: add QuestDB support
Thanks @ptma!
2026-06-14 22:58:05 +08:00
Vergil Lai f385386284
feat(manticore): add Manticore Search support
Add Manticore Search table data editing, structure editing, metadata handling, and SQL completion support.
2026-06-14 16:01:02 +08:00
t8y2 213162aad3 fix(mcp): support DBX_DATA_DIR env for portable mode 2026-06-13 20:45:58 +08:00
Vergil Lai 799d20a2cf
添加 Manticore Search 支持 (#1145)
* 添加 Manticore Search 支持

* 更新 Manticore Search 文档
2026-06-13 20:23:36 +08:00
github-actions[bot] 34dd18d46d chore(packages): release 0.4.9 [skip node-packages-release] 2026-06-13 10:28:27 +00:00
haipengno1 6265571182
feat(ssh): add ssh-agent authentication support (#1023)
Thanks for adding ssh-agent support, this is a great addition!
2026-06-11 00:39:30 +08:00
t8y2 9793dc94b7 feat(driver): centralize database capabilities 2026-06-10 22:12:44 +08:00
t8y2 d353d4673f feat(redis): add configurable key namespace separator 2026-06-10 17:46:48 +08:00
t8y2 8a458f1432 fix: add InfluxDB to agent catalog and bridge types 2026-06-10 14:46:08 +08:00
github-actions[bot] 6152b01ea8 chore(packages): release 0.4.8 [skip node-packages-release] 2026-06-10 05:57:23 +00:00
t8y2 bfec556e9b feat(readonly): add read-only mode for all database connections
- Add read_only field to ConnectionConfig with backward-compatible serde defaults
- SQL classifier with first-keyword + embedded keyword defense layers
- PRAGMA white-listing for safe read-only operations
- Guard all write entry points: SQL, Mongo, Redis, etcd, MCP Bridge
- 16 unit tests covering edge cases (CTE, case insensitivity, string masking)
- 7-language i18n support
- Fast-fail at command/route level before pool creation

Closes #889
2026-06-10 11:58:18 +08:00
runstone a440415e86 feat(readonly): add read-only mode for all database connections
## Background
Add a read-only toggle for database connections that blocks all write
operations (INSERT, UPDATE, DELETE, DROP, etc.) when enabled, allowing
only read queries (SELECT, SHOW, EXPLAIN, etc.). Closes #889.

## Changes

### Data Model
- Added `read_only: bool` field to ConnectionConfig (Rust struct, TS
  interfaces, and ConnectionConfigData deserialization layer)
- Used `#[serde(default, skip_serializing_if = "is_false")]` for
  backward/forward compatibility with existing configs

### Frontend UI
- Added "Read Only" checkbox in connection dialog
- 7-language i18n support (en/es/it/pt-BR/zh-CN/zh-TW)

### SQL Classification (query_execution_sql.rs)
- Added `is_write_sql()` with two-layer defense:
  - Layer 1: First-keyword check (must start with known read keyword)
  - Layer 2: Embedded dangerous keyword detection (catches CTE-wrapped
    writes like `WITH ... AS (DELETE FROM ...)`)
  - `FROM` keyword supported as DuckDB SELECT-less syntax indicator
- Added `check_read_only()` returning descriptive error with connection name
- Added 16 unit tests covering: pure reads/writes, CTE, case insensitivity,
  string literal masking, comment stripping, stored procedure calls, edge cases

### SQL Execution Guards (query.rs / transfer.rs)
- Added `check_read_only_for_connection()` and `_multi()` helper functions
  with lazy name clone (only allocates when read_only is true)
- 6 interception points: `do_execute`, MySQL batch, SQL Server batch,
  DuckDB batch, transaction execution, transfer execution

### Non-SQL Write Guards — Tauri Commands
- Added `ensure_connection_writable()` helper (connection.rs)
- Mongo: 6 write entry points (insert/update/delete, single + batch)
- Redis: 15 write entry points (SET, DEL, HSET, HDEL, LPUSH, LSET, LREM,
  SADD, SREM, ZADD, ZREM, EXPIRE, FLUSHDB, delete_keys, execute_command)
  - execute_command uses RedisCommandSafety classification to allow
    safe read commands through raw command interface
- etcd: 2 write entry points (put, delete)
- sql_file: SQL file execution guarded
- MCP Bridge: 4 write entry points (Insert/Update/Delete/SQL query)

### Non-SQL Write Guards — Web API
- Local `ensure_writable()` helper in each route module
- Redis: 12 write endpoints including classified execute_command
- Mongo: 6 write endpoints
- etcd: 2 write endpoints
- sql_file, table_import, transfer: early rejection

### Test Updates
- Updated ConnectionConfig construction in 7 test files with
  `read_only: false` initialization

## Defense-in-Depth
- Layer 1: Command/Route-level early rejection (saves resources)
- Layer 2: Core SQL classifier (`is_write_sql` — first keyword + embedded scan)
- Layer 3: Core execution-time interception (do_execute/transfer/transaction)
2026-06-10 10:58:52 +08:00
t8y2 edba8214b5 feat: show username/password fields for Access database connections 2026-06-10 08:37:18 +08:00
t8y2 1be4c6afcc fix: resolve clippy, typecheck, and test failures in CI (#933) 2026-06-10 04:40:23 +08:00
github-actions[bot] b200d5b041 chore(packages): release 0.4.7 [skip node-packages-release] 2026-06-08 01:54:21 +00:00
t8y2 a5659d7637 fix(mongodb): support getIndexes shell command 2026-06-08 01:25:44 +08:00
t8y2 fabf2172e4 chore: migrate test runner from node:test/tsx to vitest
155 files, 1091 tests, 4.3s (2x faster than previous 9.1s).
2026-06-08 01:17:27 +08:00
t8y2 a473f4ff8f chore: switch license to Apache-2.0 2026-06-07 17:34:59 +08:00
t8y2 74e19ec6a3 feat(databend): support agent driver 2026-06-07 16:39:22 +08:00
t8y2 a3e45cd721 feat(iotdb): add Apache IoTDB support 2026-06-07 10:29:05 +08:00
Caisin e9ee982843
Preserve ordered SSH and proxy connection layers (#802)
* Preserve ordered SSH and proxy connection layers

Replace separate SSH/proxy connection fields with ordered transport_layers while keeping legacy migration and secret fallback paths intact. The UI now edits SSH tunnel/proxy layers in configured order without a global SSH enable gate.

Constraint: Existing saved SSH tunnels, proxy settings, and secret-store keys must continue to load through migration.
Rejected: Folding proxy fields into SshTunnelConfig | mixes proxy semantics into an SSH-specific structure.
Confidence: high
Scope-risk: moderate
Directive: Keep SSH/proxy structs provider-specific; put cross-layer chaining in transport_layer_tunnel orchestration.
Tested: git diff --check; cargo fmt --check; cargo check --workspace; cargo test -p dbx-core --lib; vue-tsc --noEmit --project apps/desktop/tsconfig.json; tsc -p packages/node-core/tsconfig.json --noEmit; oxlint --vue-plugin apps/desktop/src; tsx --tsconfig apps/desktop/tsconfig.json --test packages/app-tests/*.test.ts; tsx --test packages/node-core/tests/*.test.ts
Not-tested: Live external SSH/proxy/database endpoint integration.

* Keep ordered transport changes CI-format clean

Constraint: CI pnpm check failed only on oxfmt formatting for two desktop TypeScript files
Confidence: high
Scope-risk: narrow
Directive: Keep generated/editor config changes out of this PR fix commit
Tested: PATH="/Volumes/data/code/rust/dbx/node_modules/.bin:/Users/hekx/.codex/tmp/arg0/codex-arg0nuL34n:/Users/hekx/.cargo/bin:/Users/hekx/.local/bin:/opt/homebrew/opt/llvm/bin:/opt/homebrew/opt/libpq/bin:/Volumes/data/Users/hekx/.opencode/bin:/Users/hekx/.bun/bin:/Volumes/data/sdks/flutter/bin:/Volumes/data/Users/hekx/.cargo/bin:/Users/hekx/.local/bin:/opt/homebrew/opt/llvm/bin:/opt/homebrew/opt/libpq/bin:/Volumes/data/Users/hekx/.opencode/bin:/Users/hekx/.bun/bin:/Volumes/data/Users/hekx/Library/pnpm:/Volumes/data/sdks/flutter/bin:/Volumes/data/Users/hekx/.cargo/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/pkg/env/global/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/usr/local/go/bin:/opt/homebrew/bin:/opt/podman/bin:/Applications/Ghostty.app/Contents/MacOS" rtk node scripts/run-check.mjs
Not-tested: GitHub Actions rerun not observed locally

* Keep Rust checks warning-clean

Constraint: cargo clippy --workspace --all-targets --all-features -- -D warnings failed across core, web, and tauri crates
Rejected: Broad workspace-level clippy suppression | kept allows local to long-argument command/API boundaries
Confidence: high
Scope-risk: moderate
Directive: Preserve src-tauri/tauri.conf.json as an unrelated local change outside this commit
Tested: rtk cargo clippy --workspace --all-targets --all-features -- -D warnings
Not-tested: Full GitHub Actions rerun not observed locally

* Reuse existing proxy tunnels on retry

Proxy tunnel startup now mirrors SSH tunnel behavior by returning the existing local port for an active connection id instead of replacing the managed handle. A second map check aborts a just-spawned duplicate handle if a concurrent retry won the race before insertion, preventing orphaned listeners while keeping the change narrow.

Constraint: Reviewer requested proxy tunnel behavior align with SSH local-port reuse

Rejected: Always overwrite and abort the previous handle | less consistent with SSH behavior and churns listeners during retries

Confidence: high

Scope-risk: narrow

Tested: cargo fmt --check --all

Tested: cargo test -p dbx-core db::proxy_tunnel::tests::start_tunnel_reuses_existing_local_port

Tested: cargo clippy -p dbx-core --all-targets -- -D warnings

---------

Co-authored-by: hekx <hekx@momandeMac-mini.local>
Co-authored-by: caisin <caisin@caisins-Mac-mini.local>
2026-06-06 23:22:29 +08:00
skyler d2166e080c
Merge pull request #782 from sunny0826/feat/kwdb
feat: add KWDB support
2026-06-05 18:16:17 +08:00
Xudong Guo 9b15843e1a feat: add KWDB support 2026-06-05 16:55:38 +08:00
Scars 6016b293ce
fix(cli): close direct query resources after command execution
Fix #745
2026-06-05 14:56:55 +08:00
t8y2 0887b96236 feat: add rqlite database support 2026-06-05 01:02:07 +08:00
github-actions[bot] 594077fd84 chore(packages): release 0.4.6 [skip node-packages-release] 2026-06-04 07:24:53 +00:00
t8y2 29118700b6 feat(mcp): improve setup defaults and config hints 2026-06-03 16:40:40 +08:00
t8y2 a87b8ece31 fix(mongodb): support compass shell commands 2026-06-01 16:24:31 +08:00
t8y2 46c05b811f feat(connection): support multi-hop ssh tunnels 2026-06-01 14:48:33 +08:00
t8y2 be2659447a fix(node-core): include iris in bridge diagnostics 2026-06-01 13:43:42 +08:00
github-actions[bot] 44a8471f05 chore(packages): release 0.4.5 [skip node-packages-release] 2026-05-31 16:54:39 +00:00
Guoyu Su c58e85bec5
fix(packages): resolve npm bin entrypoint detection (#567)
Fix npm/global bin entrypoint detection for CLI and MCP server by normalizing real entry paths, including symlinked invocations.
2026-05-31 14:04:44 +08:00
t8y2 bbd07e564b feat(grid): support binary cell downloads 2026-05-31 12:44:02 +08:00
Guoyu Su bc79fa4683
fix(packages): route gaussdb and opengauss through direct query (#547) 2026-05-30 19:04:40 +08:00
github-actions[bot] ba8301d909 chore(packages): release 0.4.4 [skip node-packages-release] 2026-05-30 09:22:35 +00:00
t8y2 c467372fc8 fix(packages): polish cli and mcp package contracts 2026-05-30 17:20:38 +08:00
t8y2 81e50cadb5 feat: add XuguDB agent support 2026-05-30 09:12:34 +08:00
徐文彬 5ea146e08e fix(mongodb): guard aggregate execution paths 2026-05-28 21:29:08 +08:00
徐文彬 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 32273b4d6e feat: support Redis Sentinel connections 2026-05-26 19:44:23 +08:00
t8y2 fe2ecd60d2 feat: add ClickHouse TLS connection support 2026-05-25 21:07:22 +08:00
t8y2 eb1a04b005 fix: move gaussdb and opengauss to direct query types in diagnostics 2026-05-25 19:30:19 +08:00
t8y2 dae5981e91 test(driver): add database driver manifest checks 2026-05-19 14:27:40 +08:00
t8y2 008656806e feat(oracle): support service name and SID connections 2026-05-18 21:04:37 +08:00