Commit Graph

83 Commits

Author SHA1 Message Date
t8y2 cb9863b6bb feat(drivers): prompt for agent driver updates 2026-05-17 17:06:59 +08:00
t8y2 92a6ed1a6e feat(schema): refresh stale metadata cache 2026-05-17 16:43:56 +08:00
t8y2 1bcfd02de1 feat: add Microsoft Access database support
Add Access as a new database type with agent-based connectivity,
UCanAccess JDBC URL parsing, backtick identifier quoting, file-path
connection dialog, and PNG icons for Access/GoldenDB/Vastbase.
2026-05-17 09:57:04 +08:00
t8y2 32aa7733f8 fix: refresh metadata after schema changes 2026-05-16 12:51:38 +08:00
t8y2 70e324989c fix: refresh sidebar after SQL file import 2026-05-16 12:38:53 +08:00
t8y2 2af94c6fea fix(sidebar): preserve tree expansion state after dropping a table
Remove the dropped table node directly instead of refreshing the entire
table list, which was causing all tree nodes to collapse.
2026-05-15 20:20:44 +08:00
t8y2 048f629d21 feat(export): add table selection to database export 2026-05-15 18:56:23 +08:00
t8y2 08de206644 feat(sidebar): add visible database filters 2026-05-15 17:36:51 +08:00
t8y2 2973bb1cd5 feat: add Highgo (瀚高) database support
Add full support for Highgo database, a PostgreSQL-compatible Chinese
domestic database. Includes database type definition, connection dialog,
agent driver mapping, and database icon.
2026-05-15 14:35:19 +08:00
t8y2 c2da1f866c feat(objects): show functions and procedures in sidebar tree
Add list_objects support for agent-driven databases (Dameng, Oracle, etc.)
and ExternalDriver plugin connections. SQL Server dbo schema now uses
listObjects to display grouped object nodes including routines.

- Add list_objects RPC to JDBC agent plugin
- Add extract_agent and ExternalDriver branches in list_objects_core
- Add get_object_source support for agent connections
- Click function/procedure nodes to view source via object browser
- Fix duplicate tree node IDs when same name exists as view and function
2026-05-15 13:02:19 +08:00
t8y2 c56fe29e17 fix(sidebar): preserve nested pinned tree nodes 2026-05-15 11:26:19 +08:00
t8y2 218042cfd2 fix: show schemas directly under connection for DM8 and Oracle (#259)
Single-database types (DM8, Oracle) now use list_schemas instead of
list_databases when expanding a connection, matching Navicat/DataGrip
behavior and returning the complete schema list.
2026-05-14 23:32:43 +08:00
t8y2 b6c88d7b65 feat: add persistent selected node highlight in sidebar tree
- Track selectedTreeNodeId in connection store
- Highlight any clicked tree node with focused (blue) / unfocused (gray) styles
- Use CSS :focus-within for automatic focus state switching
2026-05-14 21:52:06 +08:00
t8y2 f491ea1e43 fix: keep saved-sql-root first after database pin/unpin (#267)
orderPinnedFirst preserves relative order but doesn't account for
saved-sql-root needing to stay first. After reordering pinned children,
move saved-sql-root back to index 0 if it was displaced.
2026-05-14 18:50:24 +08:00
Abeautifulsnow 919c3d58c1
feat(redis): add key statistics tracking for database browser (#269)
## 背景说明
为 Redis 数据库浏览器增加键统计功能,显示已加载 key 数/总 key 数,
并在动态加载、删除、清空时实时更新。

## 修改内容
- 新增 \RedisDatabaseInfo\ 结构体(db + keys),替代原来的 \Vec<u32>\
- \list_databases\ 返回每个 db 的 key 数量(解析 INFO keyspace)
- \scan_keys_page\ 增加 DBSIZE 调用获取 total_keys
- 前端 TreeNode 增加 loadedKeyCount/totalKeyCount 字段
- 树节点标签动态显示 \db0 (loaded/total)\ 格式
- 新增 \updateRedisDbKeyStats\ 在加载/删除/清空时更新统计

## 测试
- 建议补充 list_keyspace_databases 解析异常输入的单测
- 建议补充 redisDbLabel 边界值测试
2026-05-14 16:24:46 +08:00
t8y2 5832e1b194 refactor(frontend): centralize database feature capabilities 2026-05-13 22:14:33 +08:00
t8y2 cb00b27963 fix(sidebar): refresh grouped object nodes 2026-05-13 18:12:55 +08:00
t8y2 48785162e3 feat: support schema-qualified table completion in SQL editor
When typing `schema.` in the SQL editor for schema-aware databases
(PostgreSQL, GaussDB, etc.), auto-complete now suggests tables from
that schema. Falls back to schema lookup when the qualifier doesn't
match any table name.

Closes #239
2026-05-13 13:09:22 +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 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 53a45330a6 feat(sidebar): group objects by type and add Object Browser context menus (#222)
Sidebar tree now groups database objects into Tables, Views, Procedures,
and Functions folders instead of a flat list. Empty groups are hidden
and each group shows its item count.

Object Browser rows now have right-click context menus with actions
like View Data, New Query, View Source, and Drop.
2026-05-12 14:33:52 +08:00
t8y2 76ff987d00 fix(sidebar): clear children cache before refreshing expanded nodes
When refreshAllTree skipped collapsed child nodes, their IDs remained
in loadedTreeNodeChildrenIds. After the parent was rebuilt with fresh
children, expanding a previously-collapsed node hit useCachedChildren
and returned immediately with empty children.
2026-05-12 14:06:10 +08:00
t8y2 e4c1d6639b fix(sidebar): 保持表列表滚动显示 2026-05-11 17:15:36 +08:00
t8y2 79277c660f feat(proxy): 增加数据库和 AI 代理支持 2026-05-11 15:05:25 +08:00
t8y2 39f33e15d4 fix(sidebar): allow search to find tables hidden behind object browser
When a database has more than 15 tables, only the first 15 are shown
in the tree with an "object browser" entry for the rest. The sidebar
search could not find tables beyond the first 15.

Store hidden table nodes on the object-browser TreeNode and search
through them in filterTree when a query is active.
2026-05-11 13:21:19 +08:00
t8y2 7197f83eda perf(sidebar): fix UI lag with 100+ databases (closes #201)
- Lower virtual scrolling threshold from 400 to 100 nodes so
  RecycleScroller activates earlier with many databases
- Memoize getConfig() with a computed Map to avoid O(n) linear
  search on every TreeItem computed property evaluation
2026-05-11 13:08:57 +08:00
t8y2 f456ddd979 perf: full-stack performance and security hardening
Frontend performance:
- Debounce DataGrid search (150ms) and replace O(n) row wrapping with index array
- Replace QueryStore deep watcher with targeted field-level persistence snapshot
- Extract shared nodeConfig computed in TreeItem (eliminates 15x redundant getConfig calls)
- Clear tab result data on close to free memory
- Add LRU eviction for completion caches (50 entry cap)
- Replace savedSql version string join with numeric counter

Memory leak fixes:
- Store Tauri event unlisten handles and clean up on unmount
- Clean up DataGrid search timer on unmount

Backend security & resource management:
- Add 50MB request body size limit
- Reject file uploads >100MB and SQL files >200MB
- Clean up SSE channels after transfer/import completes
- Recover from poisoned mutex instead of panicking
- Delete temporary upload files after preview
- Validate SQL file paths to prevent directory traversal
2026-05-11 00:18:09 +08:00
t8y2 bafb424b23 perf: full-stack performance optimization
Frontend:
- Debounce queryStore tab persistence (remove flush:sync deep watcher)
- Eliminate unnecessary object spreading in connectionStore error handling
- Use in-place delete for completion cache invalidation
- Deduplicate schema cache prefix API calls
- Split echarts, reka-ui, marked, @codemirror/commands into separate chunks
- Lazy-load xlsxExport and markdownTable in DataGrid
- Lazy-load marked parser in UpdateDialog

Backend:
- Replace tokio::sync::Mutex with RwLock for AppState connections/configs
  (60+ concurrent reads no longer block each other)
- Parallelize PostgreSQL DDL metadata queries with tokio::try_join!
2026-05-10 23:23:22 +08:00
t8y2 c6b6ba5769 feat(connections): import DBeaver connections 2026-05-10 22:10:30 +08:00
t8y2 9661c60812 feat(connections): import Navicat NCX files 2026-05-10 21:51:48 +08:00
t8y2 61bd7480f4 fix(oracle): refresh schema cache and complete table lists 2026-05-10 20:05:11 +08:00
t8y2 0e0195f734 feat(objects): add virtual object browser 2026-05-10 18:32:24 +08:00
t8y2 4cd9432fcb fix(connection): sync connection state when expanding cached tree 2026-05-10 09:11:12 +08:00
t8y2 cac383e6bf feat(sql): add saved SQL library 2026-05-10 00:33:25 +08:00
t8y2 97b77ec46d feat(diff): add data compare and schema sync coverage 2026-05-09 23:44:49 +08:00
t8y2 afb177db85 fix(connection): hide system database objects 2026-05-09 19:50:28 +08:00
t8y2 9c71442f43 feat(connection): add configurable SSH timeout 2026-05-09 19:34:30 +08:00
t8y2 5c52560368 feat(schema): 增加数据库对象列表缓存 2026-05-09 17:36:20 +08:00
t8y2 6a5dd3b51b feat(sidebar): create connections from group menu 2026-05-09 16:27:25 +08:00
t8y2 b41e548911 fix(sidebar): preserve expanded tree on refresh 2026-05-09 16:22:00 +08:00
t8y2 af029daf57 fix(db): normalize default database handling 2026-05-09 15:53:06 +08:00
Bacon2994 ce2f97a175
fix(sidebar): 修复默认库过滤数据库树 (#175) 2026-05-09 14:42:24 +08:00
t8y2 e83a3bbab9 fix: only show configured database in sidebar when specified (#160) 2026-05-08 19:52:36 +08:00
t8y2 acfe9d1b23 fix: disable native context menu and add sidebar refresh button (#159)
Prevent browser native "Reload" from resetting app state in Tauri,
and add a refresh button to the sidebar header for convenience.
2026-05-08 19:05:21 +08:00
t8y2 85be58822e fix(oracle): Oracle 11g compatibility and sidebar improvements
- Rewrite FETCH FIRST to ROWNUM for Oracle 11g (no 12c+ syntax)
- Filter APEX_*, FLOWS_*, $-prefixed system schemas from sidebar
- Set schema prefix on table nodes for schema-aware databases
- Use all_objects instead of all_tables+all_views (4x faster)
- Disable statement cache to avoid stale cursor issues
- Update rust-oracle with streaming TTC, drain fixes
2026-05-08 18:54:24 +08:00
Bacon2994 f9d6edb136 feat(connection): 支持设置默认数据库
统一新建查询的默认数据库选择逻辑,减少重复手动选择。
2026-05-07 16:49:56 +08:00
t8y2 1e7192ad1e fix: auto-migrate GaussDB/openGauss connections from postgres to gaussdb driver 2026-05-07 11:45:19 +08:00
t8y2 14292dd2f8 fix(completion): prevent PostgreSQL completion failure from breaking all subsequent completions (#131) 2026-05-07 11:25:50 +08:00