docs: sync MDX content with implementation
This commit is contained in:
parent
71f9f11eec
commit
3337826b89
|
|
@ -38,6 +38,30 @@ AI 生成的 SQL 不会自动执行。请在执行前检查表名、字段名、
|
|||
如果没有配置 API Key,AI 功能应向用户提示需要先完成设置,而不是静默失败。
|
||||
</Callout>
|
||||
|
||||
## Ask 模式与 Agent 模式
|
||||
|
||||
| 模式 | 行为 | 执行 |
|
||||
|---|---|---|
|
||||
| Ask | 生成 SQL、解释、修复、优化、方言转换或样例数据 | 不暗示已经执行 |
|
||||
| Agent | 当用户明确要求查询数据时,优先生成一条可执行 SQL | DBX 会先评估生成 SQL,再决定是否尝试执行 |
|
||||
|
||||
## Schema 上下文
|
||||
|
||||
AI 提示可以包含当前数据库类型、连接名称、数据库、当前 SQL、最近错误、结果预览和 Schema 上下文。Schema 上下文包含表、字段、索引和外键。
|
||||
|
||||
当 Schema 很大时,DBX 会截断上下文。可以在提示中使用 `@table` 或 `@schema.table` 明确提到表名,让 AI 优先围绕这些表推理。
|
||||
|
||||
## SQL 安全策略
|
||||
|
||||
| SQL 类型 | DBX 行为 |
|
||||
|---|---|
|
||||
| `SELECT`、`WITH`、`SHOW`、`DESCRIBE`、`DESC`、`EXPLAIN` 等只读语句 | 用户明确表达查询意图时,Agent 模式可自动执行 |
|
||||
| `INSERT` 或按键限定的 `UPDATE` 等低风险写入 | 只在明确非生产环境自动执行;其他情况需要确认 |
|
||||
| 多语句、`DELETE`、`MERGE`、`REPLACE`、`CREATE` 或未知 SQL | 执行前需要确认 |
|
||||
| `DROP`、`TRUNCATE`、`ALTER`、`RENAME` 或大范围 `UPDATE` 等危险语句 | 会被 AI 执行策略阻止 |
|
||||
|
||||
连接名、主机或数据库名看起来像生产环境时,DBX 会更保守。AI 生成的 SQL 仍然是模型输出,请像审查代码一样审查它。
|
||||
|
||||
## 常见用法
|
||||
|
||||
### 生成 SQL
|
||||
|
|
|
|||
|
|
@ -38,6 +38,30 @@ AI-generated SQL is not executed automatically. Review table names, columns, fil
|
|||
When no API key is configured, AI features should prompt the user to complete setup instead of failing silently.
|
||||
</Callout>
|
||||
|
||||
## Ask Mode And Agent Mode
|
||||
|
||||
| Mode | Behavior | Execution |
|
||||
|---|---|---|
|
||||
| Ask | Generates SQL, explanations, fixes, optimizations, dialect conversions, or sample data | Does not imply anything has run |
|
||||
| Agent | Prioritizes one executable SQL statement when the user clearly asks DBX to query data | DBX evaluates the generated SQL before attempting execution |
|
||||
|
||||
## Schema Context
|
||||
|
||||
AI prompts can include the current database type, connection name, database, current SQL, recent error, result preview, and schema context. Schema context contains tables, columns, indexes, and foreign keys.
|
||||
|
||||
When a schema is large, DBX truncates context. Use `@table` or `@schema.table` mentions in your prompt to prioritize the tables you want AI to reason about.
|
||||
|
||||
## SQL Safety Policy
|
||||
|
||||
| SQL Category | DBX Behavior |
|
||||
|---|---|
|
||||
| Read-only statements such as `SELECT`, `WITH`, `SHOW`, `DESCRIBE`, `DESC`, `EXPLAIN` | Can be auto-executed in Agent mode when the user clearly asks to query |
|
||||
| Scoped low-risk writes such as `INSERT` or keyed `UPDATE` | Auto-execute only in clearly non-production environments; otherwise confirm |
|
||||
| Multiple statements, `DELETE`, `MERGE`, `REPLACE`, `CREATE`, or unknown SQL | Confirm before execution |
|
||||
| Dangerous statements such as `DROP`, `TRUNCATE`, `ALTER`, `RENAME`, or broad `UPDATE` | Blocked by the AI execution policy |
|
||||
|
||||
Production-like connection names, hosts, or database names make DBX more conservative. Generated SQL is still text from an AI model; review it like code before trusting it.
|
||||
|
||||
## Common Uses
|
||||
|
||||
### Generate SQL
|
||||
|
|
|
|||
|
|
@ -46,7 +46,20 @@ description: 导出数据库连接配置(AES-256-GCM 加密),安全地在
|
|||
- 密码使用 **AES-256-GCM** 加密,密钥通过 **PBKDF2** 派生
|
||||
- 没有密码短语无法解密文件
|
||||
- 导出文件是标准 JSON 格式,可以通过 U 盘、网盘等方式传输
|
||||
- DBX 会把普通连接字段与数据库密码、SSH 密码、SSH 密钥密码、完整连接字符串等密钥信息分开存储;导出时只会在加密文件中重新组合。
|
||||
- 请把导出口令当作密钥管理。任何人同时拿到导出文件和口令,都可以恢复其中的连接。
|
||||
|
||||
## 向后兼容
|
||||
|
||||
导入同样支持旧版本导出的明文 JSON 文件(不含密码)和原始的连接配置数组。
|
||||
|
||||
## 包含哪些内容
|
||||
|
||||
| 项目 | 是否包含 |
|
||||
|---|---|
|
||||
| 连接名称、类型、主机、端口、数据库、颜色 | 包含 |
|
||||
| URL 参数、SSL、SSH、代理、可见数据库设置 | 包含 |
|
||||
| 数据库密码、SSH 密码、SSH 密钥密码、连接字符串 | 包含,并在导出文件中加密 |
|
||||
| 厂商 JDBC 驱动 JAR 文件 | 不包含;目标机器需要重新安装或导入 |
|
||||
|
||||
如果要迁移 JDBC 连接,先在这里导出连接配置,再在目标机器通过 [JDBC 插件](/cn/docs/plugins) 安装插件并导入驱动 JAR。
|
||||
|
|
|
|||
|
|
@ -46,7 +46,20 @@ Export your database connections with encrypted passwords (AES-256-GCM). Securel
|
|||
- Passwords are encrypted using **AES-256-GCM** with **PBKDF2** key derivation
|
||||
- Without the passphrase, the file cannot be decrypted
|
||||
- The export file is standard JSON, transferable via USB drive, cloud storage, etc.
|
||||
- DBX stores ordinary connection fields separately from secrets such as database passwords, SSH passwords, SSH key passphrases, and full connection strings; export brings them together only inside the encrypted export file.
|
||||
- Treat the passphrase like a secret. Anyone with both the export file and passphrase can restore the saved connections.
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
Import also supports plain JSON files from older versions (without passwords) and raw connection config arrays.
|
||||
|
||||
## What Is Included
|
||||
|
||||
| Item | Included |
|
||||
|---|---|
|
||||
| Connection name, type, host, port, database, color | Yes |
|
||||
| URL parameters, SSL, SSH, proxy, visible database settings | Yes |
|
||||
| Database password, SSH password, SSH key passphrase, connection string | Yes, encrypted in the export file |
|
||||
| Vendor JDBC driver JAR files | No; reinstall or re-import drivers on the target machine |
|
||||
|
||||
For JDBC migrations, export the connection settings here, then use [JDBC Plugin](/en/docs/plugins) to install the plugin and import driver JARs on the destination machine.
|
||||
|
|
|
|||
|
|
@ -40,6 +40,17 @@ DBX 使用虚拟滚动渲染表格,只渲染当前可视区域内的行。大
|
|||
|
||||
所有修改都会先暂存在本地。保存前,DBX 会展示即将执行的 SQL。
|
||||
|
||||
## 什么时候可以编辑
|
||||
|
||||
当 DBX 能识别目标表,并且有足够的键信息生成可审查的 `UPDATE`、`INSERT` 或 `DELETE` 语句时,结果才可编辑。直接打开表数据通常可以编辑;临时 join、聚合、表达式或没有可用主键/行标识的结果会视为只读。
|
||||
|
||||
| 结果类型 | 通常行为 |
|
||||
|---|---|
|
||||
| 打开的表数据 | 数据库和表支持时可编辑 |
|
||||
| 简单 `SELECT * FROM table` | 有主键或行标识时通常可编辑 |
|
||||
| Join、聚合、计算列 | 只读结果 |
|
||||
| Redis 或 MongoDB 视图 | 使用对应专用编辑器,不走关系型行 SQL |
|
||||
|
||||
## SQL 预览
|
||||
|
||||
<Callout type="warn">
|
||||
|
|
@ -53,6 +64,8 @@ SQL 预览会展示 `UPDATE`、`INSERT` 或 `DELETE` 语句。这个步骤可以
|
|||
- 删除操作是否命中预期行
|
||||
- `NULL`、空字符串和默认值是否符合预期
|
||||
|
||||
如果预览 SQL 的影响范围过大,请取消保存,先缩小筛选条件或选择范围。
|
||||
|
||||
## 单元格详情
|
||||
|
||||
点击单元格可以打开详情面板。它适合处理表格内不方便直接编辑的值:
|
||||
|
|
@ -73,3 +86,7 @@ SQL 预览会展示 `UPDATE`、`INSERT` 或 `DELETE` 语句。这个步骤可以
|
|||
| INSERT | 将选中行复制为可执行的 `INSERT` 语句 |
|
||||
|
||||
导出前建议先确认当前筛选和排序条件,避免导出范围和预期不一致。
|
||||
|
||||
## 分页与大结果集
|
||||
|
||||
DBX 会通过分页和虚拟滚动让大结果集保持响应。面对大表时,优先使用数据库侧的 `WHERE` 和 `ORDER BY`,不要只依赖客户端搜索;数据库可以利用索引,并返回更小的结果集。
|
||||
|
|
|
|||
|
|
@ -40,6 +40,17 @@ You can edit data directly in the grid:
|
|||
|
||||
All changes are staged locally first. Before saving, DBX shows the SQL it is about to execute.
|
||||
|
||||
## When Editing Is Available
|
||||
|
||||
Editing is available when DBX can identify the target table and enough key information to generate reviewable `UPDATE`, `INSERT`, or `DELETE` statements. Simple table browsing is usually editable. Ad-hoc joins, aggregates, expressions, or result sets without usable keys are treated as read-only.
|
||||
|
||||
| Result Type | Typical Behavior |
|
||||
|---|---|
|
||||
| Opened table data | Editable when the database and table support edits |
|
||||
| Simple `SELECT * FROM table` | Often editable if primary key or row identity is available |
|
||||
| Joins, aggregates, computed columns | Read-only result set |
|
||||
| Redis or MongoDB views | Use their dedicated editors instead of relational row SQL |
|
||||
|
||||
## SQL Preview
|
||||
|
||||
<Callout type="warn">
|
||||
|
|
@ -53,6 +64,8 @@ The preview shows `UPDATE`, `INSERT`, or `DELETE` statements. Use it to confirm:
|
|||
- Delete operations match the expected records
|
||||
- `NULL`, empty strings, and default values are handled correctly
|
||||
|
||||
If the preview looks too broad, cancel the save and narrow the filter or selection first.
|
||||
|
||||
## Cell Details
|
||||
|
||||
Click a cell to open the detail panel. It is useful for values that are awkward to edit directly inside a table:
|
||||
|
|
@ -73,3 +86,7 @@ Click a cell to open the detail panel. It is useful for values that are awkward
|
|||
| INSERT | Copy selected rows as executable `INSERT` statements |
|
||||
|
||||
Before exporting, check the active filters and sort order so the exported data matches what you expect.
|
||||
|
||||
## Pagination And Large Results
|
||||
|
||||
DBX can page result sets and keep large grids responsive with virtual scrolling. For large tables, prefer database-side `WHERE` and `ORDER BY` clauses instead of relying only on client search, because the database can use indexes and return a smaller result set.
|
||||
|
|
|
|||
|
|
@ -63,9 +63,14 @@ DBX 会在传输过程中展示:
|
|||
|---|---|
|
||||
| 创建目标表 | 目标库没有对应表时,尝试根据源表结构创建 |
|
||||
| 追加 | 将数据插入目标表现有数据之后 |
|
||||
| 清空后导入 | 先清空目标表,再写入源数据 |
|
||||
| 覆盖 | 先清空目标表,再写入源数据 |
|
||||
| Upsert | 在目标数据库路径支持时使用基于键的写入行为 |
|
||||
| 批大小 | 控制每批写入的行数 |
|
||||
|
||||
## 数据库覆盖范围
|
||||
|
||||
基于 SQL 的数据传输支持 MySQL、PostgreSQL、SQLite、SQL Server、Oracle、ClickHouse、DuckDB、DM 和 GaussDB。跨引擎传输会经过 DBX 的类型映射层,传输后请检查行数和关键字段值。
|
||||
|
||||
## 传输前检查
|
||||
|
||||
| 检查项 | 原因 |
|
||||
|
|
|
|||
|
|
@ -63,9 +63,14 @@ If a table fails, the current transfer stops and shows the error. Fix the struct
|
|||
|---|---|
|
||||
| Create target table | Try to create the target table from the source structure when it does not exist |
|
||||
| Append | Insert data after existing target rows |
|
||||
| Truncate then import | Clear the target table before writing source rows |
|
||||
| Overwrite | Clear the target table before writing source rows |
|
||||
| Upsert | Use key-aware write behavior where the target database path supports it |
|
||||
| Batch size | Control how many rows are written per batch |
|
||||
|
||||
## Database Coverage
|
||||
|
||||
SQL-based transfer is available for MySQL, PostgreSQL, SQLite, SQL Server, Oracle, ClickHouse, DuckDB, DM, and GaussDB. Cross-engine transfers use DBX's type mapping layer, so always verify row counts and important column values after transfer.
|
||||
|
||||
## Before You Transfer
|
||||
|
||||
| Check | Why It Matters |
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ description: 将数据库结构和数据导出为 SQL 文件,用于备份、
|
|||
| 表结构 | `CREATE TABLE`、字段、主键、索引、约束等 DDL |
|
||||
| 表数据 | 以 `INSERT` 语句形式导出 |
|
||||
| 批量插入 | 多行合并为一条 `INSERT`,减少文件体积和导入成本 |
|
||||
| 对象 | 数据库可提供源码时导出视图、存储过程和函数 |
|
||||
|
||||
示例:
|
||||
|
||||
|
|
@ -33,7 +34,7 @@ INSERT INTO users (id, name, email) VALUES
|
|||
<Step>
|
||||
### 设置导出选项
|
||||
|
||||
当前每张表最多导出 `10,000` 行。超过限制的表会在导出文件中标记为 truncated。
|
||||
选择是否包含结构、数据和数据库对象。可以导出全部表,也可以只导出选中的表。
|
||||
</Step>
|
||||
<Step>
|
||||
### 选择保存位置
|
||||
|
|
@ -43,18 +44,23 @@ INSERT INTO users (id, name, email) VALUES
|
|||
<Step>
|
||||
### 开始导出
|
||||
|
||||
DBX 会生成包含结构和数据的 SQL 文件。
|
||||
DBX 会生成 SQL 文件,并展示当前对象、进度、行数、错误和取消状态。
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 行数限制
|
||||
## 批量与选择
|
||||
|
||||
当前数据库导出使用固定的每表 `10,000` 行上限。这个限制适合这些场景:
|
||||
DBX 会分批读取表数据,并把生成的 `INSERT` 语句写入输出文件。如果没有设置批大小,默认每批 1000 行。
|
||||
|
||||
- 只需要表结构和少量样例数据
|
||||
- 表数据过大,不适合完整导出
|
||||
- 创建开发或测试用精简数据集
|
||||
- 分享可复现问题时,只导出必要样例
|
||||
选择部分表导出时,DBX 会先过滤表列表,再生成 DDL 和数据。视图、存储过程、函数等对象只会在启用对象导出且没有限定表子集时一起导出。
|
||||
|
||||
<Callout type="info">
|
||||
MySQL 导出会在表内容前写入 `SET FOREIGN_KEY_CHECKS = 0`,并在文件末尾重新启用。
|
||||
</Callout>
|
||||
|
||||
## 取消与错误
|
||||
|
||||
导出可以在对象之间或行批次之间取消。如果某张表或某个对象无法导出,DBX 会在 SQL 文件中写入包含错误的注释,并在可能的情况下继续导出剩余内容。
|
||||
|
||||
## 导入导出文件
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ Database Export writes table structure and table data into a SQL file. Use it be
|
|||
| Structure | `CREATE TABLE`, columns, primary keys, indexes, constraints, and other DDL |
|
||||
| Data | Rows exported as `INSERT` statements |
|
||||
| Batched inserts | Multiple rows grouped into one `INSERT` to reduce file size and import overhead |
|
||||
| Objects | Views, procedures, and functions where the database exposes source definitions |
|
||||
|
||||
Example:
|
||||
|
||||
|
|
@ -33,7 +34,7 @@ INSERT INTO users (id, name, email) VALUES
|
|||
<Step>
|
||||
### Configure Export Options
|
||||
|
||||
DBX currently exports up to `10,000` rows per table. Tables that hit the limit are marked as truncated in the generated file.
|
||||
Choose whether to include structure, data, and database objects. You can export all tables or a selected table subset.
|
||||
</Step>
|
||||
<Step>
|
||||
### Choose Output Location
|
||||
|
|
@ -43,18 +44,23 @@ INSERT INTO users (id, name, email) VALUES
|
|||
<Step>
|
||||
### Start Export
|
||||
|
||||
DBX generates a SQL file containing structure and data.
|
||||
DBX generates a SQL file and reports the current object, progress, row counts, errors, and cancellation state.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Row Limits
|
||||
## Batching And Selection
|
||||
|
||||
Database export currently uses a fixed `10,000` rows per table limit. This is useful when:
|
||||
DBX reads table data in batches and writes generated `INSERT` statements into the output file. If batch size is not set, the export uses a default batch size of 1000 rows.
|
||||
|
||||
- You only need schema plus sample data
|
||||
- Full table data is too large to export
|
||||
- You are creating a smaller dev or test dataset
|
||||
- You need a minimal reproduction file for debugging
|
||||
Selected-table export filters the table list before generating DDL and data. Routine objects such as procedures and functions are included only when object export is enabled and the export is not limited to a table subset.
|
||||
|
||||
<Callout type="info">
|
||||
For MySQL exports, DBX temporarily writes `SET FOREIGN_KEY_CHECKS = 0` before table content and re-enables it at the end of the file.
|
||||
</Callout>
|
||||
|
||||
## Cancellation And Errors
|
||||
|
||||
You can cancel an export between objects or row batches. If a specific table or object cannot be exported, DBX writes a SQL comment with the error and continues with the remaining export where possible.
|
||||
|
||||
## Importing the Export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,76 +1,100 @@
|
|||
---
|
||||
title: 数据库支持
|
||||
description: 默认通过 Rust 原生驱动支持 25+ 种数据库,也可通过可选 JDBC 插件扩展更多数据库。
|
||||
description: 了解 DBX 可以连接哪些数据库,以及每类高级功能支持哪些引擎。
|
||||
---
|
||||
|
||||
<Callout type="info">
|
||||
DBX 默认使用 Rust 原生驱动,不依赖 JDBC。需要连接更多数据库时,可以安装可选的 [JDBC 插件](/cn/docs/plugins)。
|
||||
DBX 主应用会尽量使用 Rust 原生驱动。部分数据库通过 MySQL 或 PostgreSQL 兼容协议连接,部分数据库通过 Agent 驱动或可选的 [JDBC 插件](/cn/docs/plugins) 扩展。
|
||||
</Callout>
|
||||
|
||||
## 完整支持
|
||||
## 连接类型
|
||||
|
||||
| 数据库 | 驱动 | 协议 |
|
||||
新建连接窗口会提供带默认端口和驱动标签的预设类型。
|
||||
|
||||
| 分组 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| MySQL | sqlx | MySQL |
|
||||
| PostgreSQL | sqlx | PostgreSQL |
|
||||
| SQLite | sqlx | 嵌入式 |
|
||||
| Redis | redis-rs | RESP |
|
||||
| MongoDB | mongodb | MongoDB Wire |
|
||||
| DuckDB | duckdb-rs | 嵌入式 |
|
||||
| ClickHouse | HTTP client | HTTP |
|
||||
| SQL Server | tiberius | TDS |
|
||||
| Oracle | oracle-rs | OCI |
|
||||
| Elasticsearch | HTTP client | REST |
|
||||
| DM(达梦) | odbc-api | ODBC |
|
||||
| GaussDB | rust-gaussdb | GaussDB |
|
||||
| 核心 SQL 数据库 | MySQL、PostgreSQL、SQLite、DuckDB、ClickHouse、SQL Server、Oracle、Redshift、DM、GaussDB | 直接出现在 DBX 连接选择器中 |
|
||||
| 文档与键值数据库 | Redis、MongoDB、Elasticsearch | 根据数据模型使用专门浏览器或查询流程,不完全等同于关系型表格 |
|
||||
| MySQL 兼容类型 | MariaDB、TiDB、OceanBase、Doris、SelectDB、StarRocks、GoldenDB、自定义 MySQL | 复用 MySQL 风格连接能力 |
|
||||
| PostgreSQL 兼容类型 | openGauss、KingBase、HighGo、Vastbase、CockroachDB、自定义 PostgreSQL | 复用 PostgreSQL 风格连接能力 |
|
||||
| 文件型数据库 | SQLite、DuckDB、Microsoft Access | 选择本地数据库文件,不填写主机和端口 |
|
||||
| Agent/JDBC 扩展类型 | H2、Snowflake、Trino、Hive、DB2、Informix、Neo4j、Cassandra、BigQuery、Kylin、SunDB、TDengine、JDBC | 功能覆盖取决于对应驱动路径 |
|
||||
|
||||
## MySQL 兼容
|
||||
## 默认端口
|
||||
|
||||
以下数据库使用 MySQL 协议,通过 MySQL 驱动连接,开箱即用:
|
||||
|
||||
| 数据库 | 默认端口 |
|
||||
|---|---|
|
||||
| MariaDB | 3306 |
|
||||
| 类型 | 默认端口 |
|
||||
|---|---:|
|
||||
| MySQL / MariaDB / GoldenDB | 3306 |
|
||||
| PostgreSQL / openGauss / GaussDB / Vastbase | 5432 |
|
||||
| Redis | 6379 |
|
||||
| MongoDB | 27017 |
|
||||
| ClickHouse | 8123 |
|
||||
| SQL Server | 1433 |
|
||||
| Oracle | 1521 |
|
||||
| Elasticsearch | 9200 |
|
||||
| TiDB | 4000 |
|
||||
| OceanBase | 2881 |
|
||||
| GoldenDB | 3306 |
|
||||
| Doris | 9030 |
|
||||
| SelectDB | 9030 |
|
||||
| StarRocks | 9030 |
|
||||
| Doris / SelectDB / StarRocks | 9030 |
|
||||
| Redshift | 5439 |
|
||||
| CockroachDB | 26257 |
|
||||
| DM | 5236 |
|
||||
| KingBase | 54321 |
|
||||
| HighGo | 5866 |
|
||||
| H2 | 9092 |
|
||||
| Snowflake | 443 |
|
||||
| Trino | 8080 |
|
||||
| Hive | 10000 |
|
||||
| DB2 | 50000 |
|
||||
| Informix | 9088 |
|
||||
| Neo4j | 7687 |
|
||||
| Cassandra | 9042 |
|
||||
| BigQuery | 443 |
|
||||
| Kylin | 7070 |
|
||||
| SunDB | 22000 |
|
||||
| TDengine | 6041 |
|
||||
|
||||
<Callout type="info">
|
||||
OceanBase 支持自动检测 Oracle 模式 — 当连接的 OceanBase 实例运行在 Oracle 模式下时,DBX 会自动切换为 Oracle 风格的 Schema 查询。
|
||||
SQLite、DuckDB、Access 和 JDBC 在不需要网络端口时,会在连接模型中保存为端口 `0`。
|
||||
</Callout>
|
||||
|
||||
以下数据库使用 PostgreSQL 协议,通过 PostgreSQL 驱动连接:
|
||||
## 功能矩阵
|
||||
|
||||
| 数据库 | 默认端口 |
|
||||
DBX 只会在具备足够元数据和 SQL 生成能力的数据库上启用高级功能。
|
||||
|
||||
| 功能 | 支持类型 |
|
||||
|---|---|
|
||||
| openGauss | 5432 |
|
||||
| KingBase(人大金仓) | 54321 |
|
||||
| Vastbase | 5432 |
|
||||
| Redshift | 5439 |
|
||||
| CockroachDB | 26257 |
|
||||
| Schema 感知树 | PostgreSQL、SQL Server、Oracle、Redshift、DM、GaussDB、KingBase、HighGo、Vastbase、JDBC、H2、Snowflake、Trino、DB2、TDengine |
|
||||
| ER 图 | MySQL、PostgreSQL、SQLite、SQL Server、Oracle、Redshift、DM、GaussDB、KingBase、HighGo、Vastbase、GoldenDB、Access、H2、DB2 |
|
||||
| 数据库搜索 | MySQL、PostgreSQL、SQLite、SQL Server、Oracle、Redshift、DuckDB、ClickHouse、DM、GaussDB、KingBase、HighGo、Vastbase、GoldenDB、Access、H2、Snowflake、Trino、Hive、DB2、Informix、Neo4j、Cassandra、BigQuery、Kylin、SunDB、TDengine |
|
||||
| 表数据导入 | MySQL、PostgreSQL、SQLite、DuckDB、ClickHouse、SQL Server、Oracle、Doris、StarRocks、Redshift、DM、GaussDB、KingBase、HighGo、Vastbase、GoldenDB、Access |
|
||||
| 表结构编辑器 | MySQL、PostgreSQL、SQLite、SQL Server |
|
||||
| 创建数据库 | MySQL、PostgreSQL、SQL Server、ClickHouse、Oracle、DM、GaussDB、Doris、StarRocks、Redshift |
|
||||
| 字段血缘 | MySQL、PostgreSQL、SQLite、SQL Server、Oracle、Redshift、DM、GaussDB |
|
||||
| 数据传输 | MySQL、PostgreSQL、SQLite、SQL Server、Oracle、ClickHouse、DuckDB、DM、GaussDB |
|
||||
| 不支持 SQL 文件执行 | Redis、MongoDB、Elasticsearch |
|
||||
|
||||
## ODBC 数据库
|
||||
<Callout type="warn">
|
||||
如果某个数据库可以连接,但没有出现在某个功能行中,该功能可能会被隐藏或受限。这是为了避免 DBX 生成无法可靠审查的 SQL。
|
||||
</Callout>
|
||||
|
||||
DM(达梦)通过 ODBC 连接,需要在系统上安装对应的 ODBC 驱动。
|
||||
## 连接选项
|
||||
|
||||
### DM(达梦)
|
||||
大多数网络数据库支持主机、端口、用户名、密码、默认数据库、URL 参数、SSL、连接颜色、SSH 隧道和代理设置。文件型数据库会改为选择本地文件。
|
||||
|
||||
达梦 DM8 通过 ODBC 驱动连接。默认端口:**5236**,默认用户:**SYSDBA**。
|
||||
DBX 也可以解析常见连接 URL,例如 MySQL、PostgreSQL、Redis、MongoDB、ClickHouse、SQL Server、Oracle、Elasticsearch、DM、GaussDB、openGauss、TDengine 和 Access。
|
||||
|
||||
## DM 与 ODBC
|
||||
|
||||
DM 通过 ODBC 路径连接,需要在运行 DBX 的机器上安装 DM ODBC 驱动。
|
||||
|
||||
<Tabs groupId="dm-platform" items={['Linux', 'Windows', 'macOS']}>
|
||||
<Tab value="Linux">
|
||||
```bash
|
||||
# 安装 unixODBC
|
||||
sudo apt install unixodbc
|
||||
|
||||
# 安装达梦数据库(安装包含 ODBC 驱动)
|
||||
# 安装 DM8,安装包包含 ODBC 驱动
|
||||
# 下载地址:https://eco.dameng.com/download/
|
||||
|
||||
# 在 /etc/odbcinst.ini 中注册驱动
|
||||
sudo tee -a /etc/odbcinst.ini << 'EOF'
|
||||
[DM8 ODBC DRIVER]
|
||||
Description = DM8 ODBC Driver
|
||||
|
|
@ -79,13 +103,25 @@ DM(达梦)通过 ODBC 连接,需要在系统上安装对应的 ODBC 驱动
|
|||
```
|
||||
</Tab>
|
||||
<Tab value="Windows">
|
||||
达梦安装程序会自动注册 ODBC 驱动,无需手动配置。
|
||||
DM 安装程序通常会自动注册 ODBC 驱动。
|
||||
</Tab>
|
||||
<Tab value="macOS">
|
||||
达梦暂未提供 macOS 原生 ODBC 驱动。开发/测试建议使用 Linux 环境连接。
|
||||
DM 暂未提供 macOS 原生 ODBC 驱动。开发或测试建议使用 Linux 主机连接。
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## 可选 JDBC 插件
|
||||
## 扩展支持
|
||||
|
||||
如果目标数据库不在内置支持列表中,或你必须使用厂商提供的 JDBC 驱动,可以通过 [JDBC 插件](/cn/docs/plugins) 创建 JDBC 连接。JDBC 插件不会增加 DBX 主安装包体积,也不会自动下载数据库厂商驱动。
|
||||
当目标数据库不在内置类型中,或团队必须使用厂商 JDBC 驱动时,可以使用 [JDBC 插件](/cn/docs/plugins)。JDBC 会把厂商驱动 JAR 放在 DBX 主应用之外,由你决定安装哪些驱动文件。
|
||||
|
||||
<Cards>
|
||||
<Card title="创建连接" href="/cn/docs/getting-started">
|
||||
安装 DBX、选择数据库类型并测试第一个连接。
|
||||
</Card>
|
||||
<Card title="JDBC 插件" href="/cn/docs/plugins">
|
||||
安装可选 JDBC 插件并导入厂商驱动 JAR。
|
||||
</Card>
|
||||
<Card title="SSH 隧道" href="/cn/docs/ssh-tunnel">
|
||||
连接私有网络或跳板机后的数据库。
|
||||
</Card>
|
||||
</Cards>
|
||||
|
|
|
|||
|
|
@ -1,76 +1,100 @@
|
|||
---
|
||||
title: Database Support
|
||||
description: 25+ database engines through native Rust drivers by default, with optional JDBC plugin support for more databases.
|
||||
description: Understand which databases DBX can connect to and which advanced features are available per engine.
|
||||
---
|
||||
|
||||
<Callout type="info">
|
||||
DBX uses native Rust drivers by default, with no JDBC required. For additional databases, install the optional [JDBC plugin](/docs/plugins).
|
||||
DBX uses native Rust drivers for the main app whenever possible. Some engines are compatibility profiles over MySQL or PostgreSQL protocols, and some are handled through Agent drivers or the optional [JDBC Plugin](/en/docs/plugins).
|
||||
</Callout>
|
||||
|
||||
## Fully Supported
|
||||
## Connection Profiles
|
||||
|
||||
| Database | Driver | Protocol |
|
||||
The connection dialog exposes ready-to-use profiles with default ports and driver labels.
|
||||
|
||||
| Group | Profiles | Notes |
|
||||
|---|---|---|
|
||||
| MySQL | sqlx | MySQL |
|
||||
| PostgreSQL | sqlx | PostgreSQL |
|
||||
| SQLite | sqlx | Embedded |
|
||||
| Redis | redis-rs | RESP |
|
||||
| MongoDB | mongodb | MongoDB Wire |
|
||||
| DuckDB | duckdb-rs | Embedded |
|
||||
| ClickHouse | HTTP client | HTTP |
|
||||
| SQL Server | tiberius | TDS |
|
||||
| Oracle | oracle-rs | OCI |
|
||||
| Elasticsearch | HTTP client | REST |
|
||||
| DM (Dameng) | odbc-api | ODBC |
|
||||
| GaussDB | rust-gaussdb | GaussDB |
|
||||
| Core SQL engines | MySQL, PostgreSQL, SQLite, DuckDB, ClickHouse, SQL Server, Oracle, Redshift, DM, GaussDB | Available directly in the DBX connection picker |
|
||||
| Document and key-value engines | Redis, MongoDB, Elasticsearch | Use dedicated browsers or query flows instead of the generic relational grid where appropriate |
|
||||
| MySQL-compatible profiles | MariaDB, TiDB, OceanBase, Doris, SelectDB, StarRocks, GoldenDB, custom MySQL | Reuse MySQL-style connection handling where the engine speaks a compatible protocol |
|
||||
| PostgreSQL-compatible profiles | openGauss, KingBase, HighGo, Vastbase, CockroachDB, custom PostgreSQL | Reuse PostgreSQL-style connection handling where the engine speaks a compatible protocol |
|
||||
| File-based engines | SQLite, DuckDB, Microsoft Access | Choose a local database file instead of host and port |
|
||||
| Agent/JDBC-oriented engines | H2, Snowflake, Trino, Hive, DB2, Informix, Neo4j, Cassandra, BigQuery, Kylin, SunDB, TDengine, JDBC | Feature coverage depends on the driver path used by that engine |
|
||||
|
||||
## MySQL Compatible
|
||||
## Default Ports
|
||||
|
||||
These databases use MySQL protocol and work with the MySQL driver out of the box:
|
||||
|
||||
| Database | Default Port |
|
||||
|---|---|
|
||||
| MariaDB | 3306 |
|
||||
| Profile | Default Port |
|
||||
|---|---:|
|
||||
| MySQL / MariaDB / GoldenDB | 3306 |
|
||||
| PostgreSQL / openGauss / GaussDB / Vastbase | 5432 |
|
||||
| Redis | 6379 |
|
||||
| MongoDB | 27017 |
|
||||
| ClickHouse | 8123 |
|
||||
| SQL Server | 1433 |
|
||||
| Oracle | 1521 |
|
||||
| Elasticsearch | 9200 |
|
||||
| TiDB | 4000 |
|
||||
| OceanBase | 2881 |
|
||||
| GoldenDB | 3306 |
|
||||
| Doris | 9030 |
|
||||
| SelectDB | 9030 |
|
||||
| StarRocks | 9030 |
|
||||
| Doris / SelectDB / StarRocks | 9030 |
|
||||
| Redshift | 5439 |
|
||||
| CockroachDB | 26257 |
|
||||
| DM | 5236 |
|
||||
| KingBase | 54321 |
|
||||
| HighGo | 5866 |
|
||||
| H2 | 9092 |
|
||||
| Snowflake | 443 |
|
||||
| Trino | 8080 |
|
||||
| Hive | 10000 |
|
||||
| DB2 | 50000 |
|
||||
| Informix | 9088 |
|
||||
| Neo4j | 7687 |
|
||||
| Cassandra | 9042 |
|
||||
| BigQuery | 443 |
|
||||
| Kylin | 7070 |
|
||||
| SunDB | 22000 |
|
||||
| TDengine | 6041 |
|
||||
|
||||
<Callout type="info">
|
||||
OceanBase supports automatic Oracle mode detection — when connected to an OceanBase instance running in Oracle mode, DBX automatically switches to Oracle-style schema queries.
|
||||
SQLite, DuckDB, Access, and JDBC profiles use port `0` in the saved connection model when a network port is not part of the connection.
|
||||
</Callout>
|
||||
|
||||
These databases use PostgreSQL protocol and work with the PostgreSQL driver:
|
||||
## Feature Matrix
|
||||
|
||||
| Database | Default Port |
|
||||
DBX intentionally enables advanced workflows only where the app has enough metadata and SQL-generation support.
|
||||
|
||||
| Feature | Supported Types |
|
||||
|---|---|
|
||||
| openGauss | 5432 |
|
||||
| KingBase | 54321 |
|
||||
| Vastbase | 5432 |
|
||||
| Redshift | 5439 |
|
||||
| CockroachDB | 26257 |
|
||||
| Schema-aware tree | PostgreSQL, SQL Server, Oracle, Redshift, DM, GaussDB, KingBase, HighGo, Vastbase, JDBC, H2, Snowflake, Trino, DB2, TDengine |
|
||||
| ER diagram | MySQL, PostgreSQL, SQLite, SQL Server, Oracle, Redshift, DM, GaussDB, KingBase, HighGo, Vastbase, GoldenDB, Access, H2, DB2 |
|
||||
| Database search | MySQL, PostgreSQL, SQLite, SQL Server, Oracle, Redshift, DuckDB, ClickHouse, DM, GaussDB, KingBase, HighGo, Vastbase, GoldenDB, Access, H2, Snowflake, Trino, Hive, DB2, Informix, Neo4j, Cassandra, BigQuery, Kylin, SunDB, TDengine |
|
||||
| Table import | MySQL, PostgreSQL, SQLite, DuckDB, ClickHouse, SQL Server, Oracle, Doris, StarRocks, Redshift, DM, GaussDB, KingBase, HighGo, Vastbase, GoldenDB, Access |
|
||||
| Table structure editor | MySQL, PostgreSQL, SQLite, SQL Server |
|
||||
| Create database | MySQL, PostgreSQL, SQL Server, ClickHouse, Oracle, DM, GaussDB, Doris, StarRocks, Redshift |
|
||||
| Field lineage | MySQL, PostgreSQL, SQLite, SQL Server, Oracle, Redshift, DM, GaussDB |
|
||||
| Data transfer | MySQL, PostgreSQL, SQLite, SQL Server, Oracle, ClickHouse, DuckDB, DM, GaussDB |
|
||||
| SQL file execution unavailable | Redis, MongoDB, Elasticsearch |
|
||||
|
||||
## ODBC Databases
|
||||
<Callout type="warn">
|
||||
If a database can connect but does not appear in a feature row, that feature may be hidden or limited for that engine. This prevents DBX from generating SQL it cannot review reliably.
|
||||
</Callout>
|
||||
|
||||
DM (Dameng) connects through ODBC, which requires an ODBC driver installed on your system.
|
||||
## Connection Options
|
||||
|
||||
### DM (Dameng)
|
||||
Most network databases support host, port, username, password, default database, optional URL parameters, SSL, connection color, SSH tunnel, and proxy settings. File-based engines replace host and port with a file picker.
|
||||
|
||||
DM8 connects via the DM ODBC driver. Default port: **5236**, default user: **SYSDBA**.
|
||||
DBX can also parse common connection URLs for engines such as MySQL, PostgreSQL, Redis, MongoDB, ClickHouse, SQL Server, Oracle, Elasticsearch, DM, GaussDB, openGauss, TDengine, and Access.
|
||||
|
||||
## DM And ODBC
|
||||
|
||||
DM uses an ODBC-based path and requires the DM ODBC driver installed on the machine running DBX.
|
||||
|
||||
<Tabs groupId="dm-platform" items={['Linux', 'Windows', 'macOS']}>
|
||||
<Tab value="Linux">
|
||||
```bash
|
||||
# Install unixODBC
|
||||
sudo apt install unixodbc
|
||||
|
||||
# Install DM8 (includes ODBC driver)
|
||||
# Install DM8, which includes the ODBC driver.
|
||||
# Download from https://eco.dameng.com/download/
|
||||
|
||||
# Register the driver in /etc/odbcinst.ini
|
||||
sudo tee -a /etc/odbcinst.ini << 'EOF'
|
||||
[DM8 ODBC DRIVER]
|
||||
Description = DM8 ODBC Driver
|
||||
|
|
@ -79,13 +103,25 @@ DM8 connects via the DM ODBC driver. Default port: **5236**, default user: **SYS
|
|||
```
|
||||
</Tab>
|
||||
<Tab value="Windows">
|
||||
The DM8 installer automatically registers the ODBC driver. No manual configuration needed.
|
||||
The DM installer normally registers the ODBC driver automatically.
|
||||
</Tab>
|
||||
<Tab value="macOS">
|
||||
DM does not provide a native macOS ODBC driver. For development/testing, DM is best accessed from Linux.
|
||||
DM does not provide a native macOS ODBC driver. Use a Linux host for DM development or testing when possible.
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Optional JDBC Plugin
|
||||
## Extending Support
|
||||
|
||||
If your target database is not built in, or if you must use a vendor JDBC driver, create a JDBC connection with the [JDBC plugin](/docs/plugins). The JDBC plugin does not increase the main DBX installer size and does not automatically download vendor drivers.
|
||||
Use the [JDBC Plugin](/en/docs/plugins) when a database is not covered by the built-in profiles or when your team must use a vendor JDBC driver. JDBC keeps vendor driver JARs outside the main DBX app, so you control which driver files are installed.
|
||||
|
||||
<Cards>
|
||||
<Card title="Create a Connection" href="/en/docs/getting-started">
|
||||
Install DBX, choose a database profile, and test the first connection.
|
||||
</Card>
|
||||
<Card title="JDBC Plugin" href="/en/docs/plugins">
|
||||
Install the optional JDBC plugin and import vendor driver JARs.
|
||||
</Card>
|
||||
<Card title="SSH Tunnel" href="/en/docs/ssh-tunnel">
|
||||
Reach databases behind private networks or bastion hosts.
|
||||
</Card>
|
||||
</Cards>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ description: 追踪字段之间的来源、引用和潜在关联,辅助理解
|
|||
|
||||
字段血缘用于回答一个常见问题:某个字段的数据从哪里来,又可能影响到哪里。它适合理解复杂库、排查影响范围和阅读历史结构。
|
||||
|
||||
<Callout type="info">
|
||||
字段血缘目前支持 MySQL、PostgreSQL、SQLite、SQL Server、Oracle、Redshift、DM 和 GaussDB。其他引擎可能无法提供足够的关系元数据,因此不会展示完整血缘。
|
||||
</Callout>
|
||||
|
||||
## 能解决什么问题
|
||||
|
||||
- 修改字段前,查看哪些表、视图或查询可能依赖它
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ description: Trace where columns come from, how they are referenced, and which r
|
|||
|
||||
Field Lineage helps answer a common question: where does a column's data come from, and what might depend on it? Use it to understand complex schemas, inspect impact, and read legacy structures.
|
||||
|
||||
<Callout type="info">
|
||||
Field Lineage is enabled for MySQL, PostgreSQL, SQLite, SQL Server, Oracle, Redshift, DM, and GaussDB. Other engines may not expose enough relationship metadata for DBX to build useful lineage.
|
||||
</Callout>
|
||||
|
||||
## What It Helps With
|
||||
|
||||
- Before changing a column, see which tables, views, or queries may depend on it
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ description: 安装 DBX、创建第一个连接,并了解桌面版、Docker
|
|||
本页帮助你完成三件事:
|
||||
|
||||
1. 安装 DBX 或启动 Docker 版本
|
||||
2. 创建第一个数据库连接
|
||||
3. 在需要参与开发时从源码运行项目
|
||||
2. 创建并测试第一个数据库连接
|
||||
3. 在需要参与开发或本地调试时从源码运行 DBX
|
||||
|
||||
## 选择安装方式
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ description: 安装 DBX、创建第一个连接,并了解桌面版、Docker
|
|||
brew install --cask t8y2/tap/dbx
|
||||
```
|
||||
|
||||
更新到最新版本:
|
||||
之后可用以下命令更新:
|
||||
|
||||
```bash
|
||||
brew upgrade --cask t8y2/tap/dbx
|
||||
|
|
@ -35,7 +35,7 @@ description: 安装 DBX、创建第一个连接,并了解桌面版、Docker
|
|||
scoop install dbx
|
||||
```
|
||||
|
||||
更新到最新版本:
|
||||
之后可用以下命令更新:
|
||||
|
||||
```bash
|
||||
scoop update dbx
|
||||
|
|
@ -44,11 +44,11 @@ description: 安装 DBX、创建第一个连接,并了解桌面版、Docker
|
|||
也可以从 [GitHub Releases](https://github.com/t8y2/dbx/releases) 下载 `.msi` 安装包。
|
||||
</Tab>
|
||||
<Tab value="Linux">
|
||||
从 [GitHub Releases](https://github.com/t8y2/dbx/releases) 下载对应的安装包:
|
||||
从 [GitHub Releases](https://github.com/t8y2/dbx/releases) 下载对应安装包:
|
||||
|
||||
| 格式 | 适用场景 |
|
||||
|---|---|
|
||||
| `.deb` | Debian、Ubuntu 及其衍生发行版 |
|
||||
| `.deb` | Debian、Ubuntu 及兼容发行版 |
|
||||
| `.AppImage` | 通用 Linux 桌面环境 |
|
||||
|
||||
如果使用 `.AppImage`,首次运行前可能需要添加执行权限:
|
||||
|
|
@ -58,7 +58,7 @@ description: 安装 DBX、创建第一个连接,并了解桌面版、Docker
|
|||
```
|
||||
</Tab>
|
||||
<Tab value="Docker">
|
||||
Docker 版本适合部署在服务器上,通过浏览器访问 DBX:
|
||||
Docker 版本适合部署在服务器上,并通过浏览器访问:
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
|
|
@ -70,7 +70,7 @@ description: 安装 DBX、创建第一个连接,并了解桌面版、Docker
|
|||
|
||||
启动后访问 `http://localhost:4224`。
|
||||
|
||||
使用 Docker Compose:
|
||||
Docker Compose:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
|
|
@ -88,8 +88,15 @@ description: 安装 DBX、创建第一个连接,并了解桌面版、Docker
|
|||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## 桌面版还是 Docker
|
||||
|
||||
| 模式 | 适合场景 | 后端路径 | 存储位置 |
|
||||
|---|---|---|---|
|
||||
| 桌面版 | 本机日常工作、本地文件、原生窗口、从 MCP 打开 DBX 界面 | Tauri 命令调用 Rust core | 本机应用数据目录 |
|
||||
| Docker / Web | 服务器自托管、浏览器访问 | HTTP 路由调用同一套 Rust core | Docker volume 或服务器数据目录 |
|
||||
|
||||
<Callout type="info">
|
||||
桌面版更适合个人本机使用;Docker 版更适合服务器、自托管和浏览器访问。两者的核心功能保持一致,但部署和数据存储位置不同。
|
||||
核心数据库能力保持一致,但通过 MCP 打开桌面窗口等集成需要 DBX 桌面版正在运行。
|
||||
</Callout>
|
||||
|
||||
## 创建第一个连接
|
||||
|
|
@ -103,40 +110,52 @@ description: 安装 DBX、创建第一个连接,并了解桌面版、Docker
|
|||
<Step>
|
||||
### 选择数据库类型
|
||||
|
||||
选择 MySQL、PostgreSQL、SQLite、Redis、MongoDB 等数据库类型。
|
||||
选择 MySQL、PostgreSQL、SQLite、Redis、MongoDB、DuckDB、ClickHouse、SQL Server、Oracle,或 [数据库支持](/cn/docs/databases) 中列出的兼容类型、Agent/JDBC 类型。
|
||||
</Step>
|
||||
<Step>
|
||||
### 填写连接信息
|
||||
|
||||
填写主机、端口、用户名和密码。对于 PostgreSQL、MySQL 等数据库,可以设置默认数据库,连接后自动进入指定数据库。
|
||||
网络数据库需要填写主机、端口、用户名、密码和必要的默认数据库。SQLite、DuckDB、Access 这类文件型数据库需要选择本地数据库文件,不填写主机和端口。
|
||||
</Step>
|
||||
<Step>
|
||||
### 测试连接
|
||||
### 有 URL 时直接粘贴
|
||||
|
||||
点击 **测试** 验证网络、账号和权限是否正常。如果数据库在内网或跳板机后面,可以启用 [SSH 隧道](/cn/docs/ssh-tunnel)。
|
||||
DBX 可以解析常见连接 URL,例如 MySQL、PostgreSQL、Redis、MongoDB、ClickHouse、SQL Server、Oracle、Elasticsearch、DM、GaussDB、openGauss、TDengine 和 Access。保存前请检查解析出的字段。
|
||||
</Step>
|
||||
<Step>
|
||||
### 保存并连接
|
||||
### 配置网络选项
|
||||
|
||||
测试通过后点击 **保存并连接**。连接会出现在侧边栏中,之后可以直接打开。
|
||||
如果数据库在内网或跳板机后面,可以启用 [SSH 隧道](/cn/docs/ssh-tunnel)。如果网络环境要求 SOCKS5 或 HTTP 代理,可以在代理页签中配置。
|
||||
</Step>
|
||||
<Step>
|
||||
### 测试并保存
|
||||
|
||||
点击 **测试** 验证账号、网络和权限。测试通过后保存连接,并从侧边栏打开。
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Callout type="info">
|
||||
连接配置保存在本机应用数据目录的 SQLite 数据库中。密码、SSH 密码、SSH 密钥密码和连接字符串会从普通连接 JSON 中拆出,单独存放在 `connection_secrets` 表。
|
||||
连接密码、SSH 密码、SSH 密钥密码和连接字符串会与普通连接 JSON 分开存储在 DBX 本地数据中。需要迁移加密连接配置时,使用 [配置导出/导入](/cn/docs/config-export)。
|
||||
</Callout>
|
||||
|
||||
## 连接后可以做什么
|
||||
## 降低生产误操作
|
||||
|
||||
- 给生产连接起明确名称,例如 `prod-orders`。
|
||||
- 用连接颜色区分生产、预发、测试和本地环境。
|
||||
- 一个服务器上数据库很多时,只显示当前需要的数据库。
|
||||
- 对编辑、导入、传输、SQL 文件执行或 Schema 同步生成的 SQL,先审查再执行。
|
||||
|
||||
## 下一步可以做什么
|
||||
|
||||
<Cards>
|
||||
<Card title="写 SQL" href="/cn/docs/query-editor">
|
||||
打开查询编辑器,使用补全、格式化、选中执行和查询历史。
|
||||
使用补全、格式化、选中执行、取消执行和查询历史。
|
||||
</Card>
|
||||
<Card title="看数据" href="/cn/docs/data-grid">
|
||||
打开表数据,使用过滤、排序、行内编辑和 SQL 预览。
|
||||
查看结果、在安全时编辑行、预览 SQL 并导出数据。
|
||||
</Card>
|
||||
<Card title="看结构" href="/cn/docs/schema-browser">
|
||||
从侧边栏浏览库、Schema、表、字段、索引和外键。
|
||||
浏览数据库、Schema、表、字段、Redis 键和 MongoDB 集合。
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
|
|
@ -144,14 +163,15 @@ description: 安装 DBX、创建第一个连接,并了解桌面版、Docker
|
|||
|
||||
| 现象 | 检查项 |
|
||||
|---|---|
|
||||
| 连接超时 | 主机地址、端口、防火墙、安全组、VPN 或内网访问权限 |
|
||||
| 认证失败 | 用户名、密码、认证方式、账号是否允许远程登录 |
|
||||
| 能连接但看不到表 | 默认数据库、Schema 权限、账号是否有读取元数据的权限 |
|
||||
| 内网数据库无法访问 | 配置 SSH 隧道,或确认 Docker 部署所在机器能访问目标数据库 |
|
||||
| 连接超时 | 主机、端口、防火墙、安全组、VPN、Docker 主机网络或内网访问权限 |
|
||||
| 认证失败 | 用户名、密码、认证方式、SSL 要求、账号是否允许远程登录 |
|
||||
| 能连接但看不到表 | 默认数据库、Schema、权限、元数据读取权限、可见数据库过滤 |
|
||||
| 文件数据库打不开 | 文件路径、文件权限、Docker volume 挂载、文件扩展名是否支持 |
|
||||
| 内网数据库无法访问 | 配置 SSH 隧道、代理、VPN,或让 Docker 部署机器能访问目标数据库 |
|
||||
|
||||
## 从源码运行
|
||||
|
||||
如果你想参与开发或本地调试 DBX,可以从源码运行。
|
||||
当你想参与开发或本地调试 DBX 时,可以从源码运行。
|
||||
|
||||
### 环境要求
|
||||
|
||||
|
|
@ -173,7 +193,7 @@ description: 安装 DBX、创建第一个连接,并了解桌面版、Docker
|
|||
```
|
||||
</Tab>
|
||||
<Tab value="Windows">
|
||||
Windows 已内置 ODBC,通常不需要额外安装系统依赖。
|
||||
Windows 通常不需要额外安装系统依赖。
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
|
@ -186,10 +206,17 @@ pnpm install
|
|||
pnpm dev:tauri
|
||||
```
|
||||
|
||||
Web 版本:
|
||||
|
||||
```bash
|
||||
pnpm dev:web
|
||||
pnpm dev:backend
|
||||
```
|
||||
|
||||
### 构建桌面安装包
|
||||
|
||||
```bash
|
||||
pnpm tauri build
|
||||
```
|
||||
|
||||
构建产物会输出到 `src-tauri/target/release/bundle/`。
|
||||
桌面安装包会输出到 `src-tauri/target/release/bundle/`。
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
---
|
||||
title: Getting Started
|
||||
description: Install DBX, create your first connection, and understand the desktop, Docker, and source-based workflows.
|
||||
description: Install DBX, create your first connection, and understand the desktop, Docker, and source workflows.
|
||||
---
|
||||
|
||||
This guide gets you through three steps:
|
||||
This guide gets you through three things:
|
||||
|
||||
1. Install DBX or start the Docker version
|
||||
2. Create your first database connection
|
||||
3. Run the project from source when you want to contribute or debug locally
|
||||
2. Create and test your first database connection
|
||||
3. Run DBX from source when you want to contribute or debug locally
|
||||
|
||||
## Choose an Install Method
|
||||
## Choose An Install Method
|
||||
|
||||
<Tabs groupId="platform" items={['macOS', 'Windows', 'Linux', 'Docker']}>
|
||||
<Tab value="macOS">
|
||||
|
|
@ -19,13 +19,13 @@ This guide gets you through three steps:
|
|||
brew install --cask t8y2/tap/dbx
|
||||
```
|
||||
|
||||
Upgrade to the latest version:
|
||||
Update later with:
|
||||
|
||||
```bash
|
||||
brew upgrade --cask t8y2/tap/dbx
|
||||
```
|
||||
|
||||
You can also download the `.dmg` installer from [GitHub Releases](https://github.com/t8y2/dbx/releases).
|
||||
You can also download a `.dmg` installer from [GitHub Releases](https://github.com/t8y2/dbx/releases).
|
||||
</Tab>
|
||||
<Tab value="Windows">
|
||||
Install with Scoop:
|
||||
|
|
@ -35,30 +35,30 @@ This guide gets you through three steps:
|
|||
scoop install dbx
|
||||
```
|
||||
|
||||
Upgrade to the latest version:
|
||||
Update later with:
|
||||
|
||||
```bash
|
||||
scoop update dbx
|
||||
```
|
||||
|
||||
You can also download the `.msi` installer from [GitHub Releases](https://github.com/t8y2/dbx/releases).
|
||||
You can also download a `.msi` installer from [GitHub Releases](https://github.com/t8y2/dbx/releases).
|
||||
</Tab>
|
||||
<Tab value="Linux">
|
||||
Download the right package from [GitHub Releases](https://github.com/t8y2/dbx/releases):
|
||||
Download a package from [GitHub Releases](https://github.com/t8y2/dbx/releases):
|
||||
|
||||
| Format | Best For |
|
||||
| Format | Use Case |
|
||||
|---|---|
|
||||
| `.deb` | Debian, Ubuntu, and related distributions |
|
||||
| `.AppImage` | General Linux desktop environments |
|
||||
| `.deb` | Debian, Ubuntu, and compatible distributions |
|
||||
| `.AppImage` | Portable Linux desktop usage |
|
||||
|
||||
For `.AppImage`, you may need to make the file executable first:
|
||||
For `.AppImage`, make the file executable before first run:
|
||||
|
||||
```bash
|
||||
chmod +x DBX*.AppImage
|
||||
```
|
||||
</Tab>
|
||||
<Tab value="Docker">
|
||||
Use Docker when you want to host DBX on a server and access it from a browser:
|
||||
Docker is for self-hosting DBX on a server and opening it from a browser:
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
|
|
@ -68,7 +68,7 @@ This guide gets you through three steps:
|
|||
t8y2/dbx
|
||||
```
|
||||
|
||||
Open `http://localhost:4224` after the container starts.
|
||||
Then open `http://localhost:4224`.
|
||||
|
||||
Docker Compose:
|
||||
|
||||
|
|
@ -88,8 +88,15 @@ This guide gets you through three steps:
|
|||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Desktop Or Docker
|
||||
|
||||
| Mode | Best For | Backend Path | Storage |
|
||||
|---|---|---|---|
|
||||
| Desktop | Daily local work, local files, native windows, DBX UI opened from MCP | Tauri commands calling the Rust core | Local app data directory |
|
||||
| Docker / Web | Self-hosted access from a server or browser | HTTP routes calling the same Rust core | Docker volume or server data directory |
|
||||
|
||||
<Callout type="info">
|
||||
Use the desktop app for personal local work. Use Docker for server-hosted or browser-based access. The core product is the same, but deployment and data storage differ.
|
||||
The core database features are shared, but desktop-only integrations such as opening DBX windows from MCP require the desktop app to be running.
|
||||
</Callout>
|
||||
|
||||
## Create Your First Connection
|
||||
|
|
@ -101,59 +108,72 @@ Use the desktop app for personal local work. Use Docker for server-hosted or bro
|
|||
Click **New Connection** from the sidebar or toolbar.
|
||||
</Step>
|
||||
<Step>
|
||||
### Choose a Database Type
|
||||
### Pick A Database Type
|
||||
|
||||
Select MySQL, PostgreSQL, SQLite, Redis, MongoDB, or another supported engine.
|
||||
Choose a built-in profile such as MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, ClickHouse, SQL Server, Oracle, or one of the compatibility and Agent/JDBC profiles listed in [Database Support](/en/docs/databases).
|
||||
</Step>
|
||||
<Step>
|
||||
### Enter Connection Details
|
||||
### Fill Connection Details
|
||||
|
||||
Fill in host, port, username, and password. For engines such as PostgreSQL and MySQL, you can set a default database so DBX opens it automatically after connecting.
|
||||
For network databases, enter host, port, username, password, and default database when needed. For SQLite, DuckDB, and Access, select a local database file instead of host and port.
|
||||
</Step>
|
||||
<Step>
|
||||
### Test the Connection
|
||||
### Paste A URL When Available
|
||||
|
||||
Click **Test** to verify network access, credentials, and permissions. If the database is behind a private network or bastion host, configure an [SSH Tunnel](/en/docs/ssh-tunnel).
|
||||
DBX can parse common connection URLs for engines such as MySQL, PostgreSQL, Redis, MongoDB, ClickHouse, SQL Server, Oracle, Elasticsearch, DM, GaussDB, openGauss, TDengine, and Access. Review the parsed fields before saving.
|
||||
</Step>
|
||||
<Step>
|
||||
### Save and Connect
|
||||
### Add Network Options
|
||||
|
||||
When the test succeeds, click **Save & Connect**. The connection appears in the sidebar for future use.
|
||||
Enable [SSH Tunnel](/en/docs/ssh-tunnel) for databases behind private networks or bastion hosts. Use the proxy tab when your environment requires SOCKS5 or HTTP proxy access.
|
||||
</Step>
|
||||
<Step>
|
||||
### Test And Save
|
||||
|
||||
Click **Test** to verify credentials, network access, and permissions. After the test passes, save the connection and open it from the sidebar.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Callout type="info">
|
||||
Connection configuration is stored in a local SQLite database under the app data directory. Passwords, SSH passwords, SSH key passphrases, and connection strings are removed from the normal connection JSON and stored separately in the `connection_secrets` table.
|
||||
Connection passwords, SSH passwords, SSH key passphrases, and connection strings are stored separately from the regular connection JSON in DBX's local storage. Use [Config Export/Import](/en/docs/config-export) when you need to migrate encrypted connection settings.
|
||||
</Callout>
|
||||
|
||||
## What to Try Next
|
||||
## Reduce Production Mistakes
|
||||
|
||||
- Give production connections a distinct name, for example `prod-orders`.
|
||||
- Use connection colors so production, staging, and local databases are visually different.
|
||||
- Use visible database filtering when a server contains many databases but you only need a few.
|
||||
- Review generated SQL before applying edits, imports, transfers, SQL files, or schema sync operations.
|
||||
|
||||
## What To Try Next
|
||||
|
||||
<Cards>
|
||||
<Card title="Write SQL" href="/en/docs/query-editor">
|
||||
Open the query editor and use completion, formatting, selected execution, and query history.
|
||||
Use completion, formatting, selected execution, cancellation, and history.
|
||||
</Card>
|
||||
<Card title="Browse Data" href="/en/docs/data-grid">
|
||||
Open table data and use filtering, sorting, inline editing, and SQL preview.
|
||||
Inspect results, edit rows when safe, preview SQL, and export data.
|
||||
</Card>
|
||||
<Card title="Explore Schema" href="/en/docs/schema-browser">
|
||||
Browse databases, schemas, tables, columns, indexes, and foreign keys from the sidebar.
|
||||
Browse databases, schemas, tables, columns, Redis keys, and MongoDB collections.
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
## Common Connection Issues
|
||||
## Common Connection Problems
|
||||
|
||||
| Symptom | Check |
|
||||
|---|---|
|
||||
| Connection timeout | Host, port, firewall, security group, VPN, or private network access |
|
||||
| Authentication failed | Username, password, auth method, and whether the account allows remote login |
|
||||
| Connected but no tables are visible | Default database, schema permissions, and metadata read permissions |
|
||||
| Private database is unreachable | Configure an SSH tunnel, or make sure the Docker host can reach the database |
|
||||
| Timeout | Host, port, firewall, security group, VPN, Docker host reachability, or private network access |
|
||||
| Authentication failed | Username, password, auth mode, SSL requirement, remote login permission |
|
||||
| Connected but no tables | Default database, schema, permissions, metadata read access, visible database filter |
|
||||
| File database cannot open | File path, file permissions, mounted Docker volume, or unsupported file extension |
|
||||
| Private database unreachable | Configure SSH tunnel, proxy, VPN, or run Docker on a machine that can reach the database |
|
||||
|
||||
## Run From Source
|
||||
|
||||
Use the source workflow when you want to contribute or debug DBX locally.
|
||||
Use source mode when contributing or debugging DBX locally.
|
||||
|
||||
### Prerequisites
|
||||
### Requirements
|
||||
|
||||
- [Node.js](https://nodejs.org/) >= 18
|
||||
- [pnpm](https://pnpm.io/)
|
||||
|
|
@ -173,11 +193,11 @@ Use the source workflow when you want to contribute or debug DBX locally.
|
|||
```
|
||||
</Tab>
|
||||
<Tab value="Windows">
|
||||
Windows includes ODBC support, so additional system dependencies are usually not required.
|
||||
Windows usually needs no extra system dependency for local DBX development.
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
### Start the Development App
|
||||
### Start Development
|
||||
|
||||
```bash
|
||||
git clone https://github.com/t8y2/dbx.git
|
||||
|
|
@ -186,10 +206,17 @@ pnpm install
|
|||
pnpm dev:tauri
|
||||
```
|
||||
|
||||
### Build the Desktop App
|
||||
For the web version:
|
||||
|
||||
```bash
|
||||
pnpm dev:web
|
||||
pnpm dev:backend
|
||||
```
|
||||
|
||||
### Build Desktop Packages
|
||||
|
||||
```bash
|
||||
pnpm tauri build
|
||||
```
|
||||
|
||||
Build artifacts are written to `src-tauri/target/release/bundle/`.
|
||||
Desktop installers are written to `src-tauri/target/release/bundle/`.
|
||||
|
|
|
|||
|
|
@ -124,6 +124,17 @@ DBX MCP Server 提供以下工具,AI 助手会根据你的需求自动调用
|
|||
| `connection_name` | 是 | DBX 连接名称 |
|
||||
| `sql` | 是 | SQL 查询语句 |
|
||||
|
||||
### `dbx_get_schema_context`
|
||||
|
||||
返回用于生成 SQL 的紧凑表结构上下文。
|
||||
|
||||
| 参数 | 必填 | 说明 |
|
||||
|---|---|---|
|
||||
| `connection_name` | 是 | DBX 连接名称 |
|
||||
| `schema` | 否 | Schema 名称 |
|
||||
| `tables` | 否 | 指定要包含的表名 |
|
||||
| `max_tables` | 否 | 最多包含多少张表,范围限制在 1 到 20 |
|
||||
|
||||
### `dbx_add_connection`
|
||||
|
||||
添加新的数据库连接。
|
||||
|
|
@ -198,7 +209,28 @@ AI 助手 → MCP Server → HTTP localhost → DBX 后端 → Tauri 事件 →
|
|||
|
||||
### 支持的数据库
|
||||
|
||||
MCP 查询支持 PostgreSQL 和 MySQL(及兼容数据库:Doris、StarRocks 等)。UI 联动(打开表)支持 DBX 已支持的所有数据库类型。
|
||||
桌面本地模式下,MCP 查询支持 PostgreSQL、MySQL 及兼容数据库。Web 模式会通过 `DBX_WEB_URL` 转发到 DBX Web 后端。打开表等 UI 联动能力支持当前 DBX 桌面端可以打开的所有数据库类型。
|
||||
|
||||
### SQL 安全
|
||||
|
||||
MCP 查询执行默认非常保守:
|
||||
|
||||
| 规则 | 默认行为 |
|
||||
|---|---|
|
||||
| 空 SQL 或无法识别的 SQL | 阻止 |
|
||||
| 超过一条 SQL 语句 | 阻止 |
|
||||
| 非只读 SQL | 阻止,除非显式允许写入 |
|
||||
| `DROP`、`TRUNCATE`、`ALTER` | 阻止,除非显式允许危险 SQL |
|
||||
| 允许写入时没有 `WHERE` 的 `UPDATE` 或 `DELETE` | 阻止 |
|
||||
|
||||
设置 `DBX_MCP_ALLOW_WRITES=1` 可以允许写入语句。只有在受控环境并且确实需要破坏性 SQL 时,才设置 `DBX_MCP_ALLOW_DANGEROUS_SQL=1`。
|
||||
|
||||
### 桌面模式与 Web 模式
|
||||
|
||||
| 模式 | 如何选择 | 说明 |
|
||||
|---|---|---|
|
||||
| 桌面本地模式 | 默认 | 读取 DBX 桌面端连接存储,并可调用桌面专属 UI bridge 工具 |
|
||||
| Web 模式 | 设置 `DBX_WEB_URL` | 不读取本机桌面存储,而是把请求发给 DBX Web 后端 |
|
||||
|
||||
## 常见问题
|
||||
|
||||
|
|
|
|||
|
|
@ -124,6 +124,17 @@ Execute a SQL query and return results (max 100 rows).
|
|||
| `connection_name` | Yes | DBX connection name |
|
||||
| `sql` | Yes | SQL query |
|
||||
|
||||
### `dbx_get_schema_context`
|
||||
|
||||
Return compact table and column context for SQL generation.
|
||||
|
||||
| Parameter | Required | Description |
|
||||
|---|---|---|
|
||||
| `connection_name` | Yes | DBX connection name |
|
||||
| `schema` | No | Schema name |
|
||||
| `tables` | No | Specific table names to include |
|
||||
| `max_tables` | No | Maximum number of tables to include; capped between 1 and 20 |
|
||||
|
||||
### `dbx_add_connection`
|
||||
|
||||
Add a new database connection to DBX.
|
||||
|
|
@ -198,7 +209,28 @@ AI Agent → MCP Server → HTTP localhost → DBX backend → Tauri event → F
|
|||
|
||||
### Supported Databases
|
||||
|
||||
MCP query support: PostgreSQL, MySQL, and compatible databases (Doris, StarRocks, etc.). UI integration (open table) supports all database types in DBX.
|
||||
MCP query support in desktop local mode is implemented for PostgreSQL, MySQL, and compatible databases. Web mode delegates to the DBX web backend configured by `DBX_WEB_URL`. UI integration such as opening a table supports all database types that the running DBX desktop app can open.
|
||||
|
||||
### SQL Safety
|
||||
|
||||
MCP query execution is intentionally conservative:
|
||||
|
||||
| Rule | Default |
|
||||
|---|---|
|
||||
| Empty or unrecognized SQL | Blocked |
|
||||
| More than one SQL statement | Blocked |
|
||||
| Non-read SQL | Blocked unless writes are explicitly allowed |
|
||||
| `DROP`, `TRUNCATE`, or `ALTER` | Blocked unless dangerous SQL is explicitly allowed |
|
||||
| `UPDATE` or `DELETE` without `WHERE` when writes are allowed | Blocked |
|
||||
|
||||
Set `DBX_MCP_ALLOW_WRITES=1` to allow write statements. Set `DBX_MCP_ALLOW_DANGEROUS_SQL=1` only in controlled environments where destructive SQL is expected.
|
||||
|
||||
### Desktop And Web Mode
|
||||
|
||||
| Mode | How It Is Selected | Notes |
|
||||
|---|---|---|
|
||||
| Desktop local mode | Default | Reads DBX desktop connection storage and can call desktop-only UI bridge tools |
|
||||
| Web mode | Set `DBX_WEB_URL` | Sends requests to the DBX web backend instead of reading local desktop storage |
|
||||
|
||||
## FAQ
|
||||
|
||||
|
|
|
|||
|
|
@ -292,4 +292,10 @@ DBX 会启动插件可执行文件,并通过 stdin/stdout 发送 JSON Lines
|
|||
}
|
||||
```
|
||||
|
||||
当前 DBX 主应用支持插件协议版本 `1`。如果插件 manifest 声明了不同协议版本,DBX 会拒绝加载;每次插件请求也有 30 秒超时,避免驱动进程卡住后无限阻塞应用。
|
||||
|
||||
第一版协议支持 `testConnection`、`connect`、`executeQuery`、`listDatabases`、`listSchemas`、`listTables` 和 `getColumns`。
|
||||
|
||||
<Callout type="info">
|
||||
JDBC 连接配置会保存 `jdbc_driver_class` 和 `jdbc_driver_paths`。如果一个驱动需要多个 JAR,请把所有路径都绑定到连接上,这样元数据和查询调用会使用同一套 classpath。
|
||||
</Callout>
|
||||
|
|
|
|||
|
|
@ -292,4 +292,10 @@ The plugin directory must include `manifest.json`:
|
|||
}
|
||||
```
|
||||
|
||||
The current DBX app supports plugin protocol version `1`. DBX rejects a plugin whose manifest declares a different protocol version, and each plugin request has a 30 second timeout so a hung driver process does not block the app indefinitely.
|
||||
|
||||
The initial protocol supports `testConnection`, `connect`, `executeQuery`, `listDatabases`, `listSchemas`, `listTables`, and `getColumns`.
|
||||
|
||||
<Callout type="info">
|
||||
JDBC connection configs store `jdbc_driver_class` and `jdbc_driver_paths`. If a driver needs several JARs, keep all paths attached to the connection so metadata and query calls use the same classpath.
|
||||
</Callout>
|
||||
|
|
|
|||
|
|
@ -43,6 +43,20 @@ description: 使用 DBX 的 SQL 编辑器编写、补全、格式化、执行和
|
|||
|
||||
执行完成后,结果区域会展示返回行、耗时、影响行数或错误信息。多语句执行时,建议先选中要执行的片段,减少误操作。
|
||||
|
||||
DBX 也会跟踪查询会话,离开结果集时可以关闭会话;当数据库驱动支持取消时,正在执行的查询也可以从界面中取消。
|
||||
|
||||
## 执行范围
|
||||
|
||||
| 范围 | 如何确定 | 适合场景 |
|
||||
|---|---|---|
|
||||
| 选中 SQL | 执行前先高亮文本 | 多语句草稿中最安全 |
|
||||
| 当前语句 | 使用编辑器光标相关流程 | 不手动选择文本时运行单条语句 |
|
||||
| 全部内容 | 没有选中文本时执行 | 单用途查询标签页或短脚本 |
|
||||
|
||||
<Callout type="warn">
|
||||
DBX 可以执行批量 SQL 和脚本,但在查询编辑器里仍建议一次运行一条已审查语句。大型 `.sql` 文件请使用带进度跟踪的 [SQL 文件执行](/cn/docs/sql-file)。
|
||||
</Callout>
|
||||
|
||||
## 自动补全
|
||||
|
||||
补全建议来自当前连接的数据库上下文:
|
||||
|
|
@ -71,6 +85,7 @@ DBX 会记录已经执行过的 SQL,方便复用:
|
|||
- 可以按时间查看之前执行的语句
|
||||
- 点击历史记录可重新填入编辑器
|
||||
- 适合找回临时排查 SQL、报表查询和修复语句
|
||||
- 历史记录会保留足够上下文,用于区分手写查询和 AI 辅助操作
|
||||
|
||||
<Callout type="warn">
|
||||
查询历史可能包含业务字段、表名或筛选条件。共享电脑或演示环境中,建议注意历史记录里的敏感信息。
|
||||
|
|
@ -79,3 +94,7 @@ DBX 会记录已经执行过的 SQL,方便复用:
|
|||
## 与数据表格配合
|
||||
|
||||
查询结果会进入 [数据表格](/cn/docs/data-grid)。如果查询结果可编辑,DBX 会在保存前展示将要执行的 SQL;如果只是临时分析,可以直接导出 CSV、JSON 或 Markdown。
|
||||
|
||||
## 与 AI 配合
|
||||
|
||||
编辑器可以把当前 SQL、连接类型、数据库名、最近错误、结果预览和已加载的 Schema 上下文发送给 [AI 助手](/cn/docs/ai-assistant)。Ask 模式只返回 SQL 和说明;Agent 模式会先经过 DBX 的执行策略,再决定是否尝试执行生成的 SQL。
|
||||
|
|
|
|||
|
|
@ -43,6 +43,20 @@ When text is selected, DBX executes only the selected SQL. When nothing is selec
|
|||
|
||||
After execution, the result area shows returned rows, duration, affected row count, or the error message. For multi-statement scripts, select the exact fragment you want to run to reduce mistakes.
|
||||
|
||||
DBX also tracks query sessions so long-running result sets can be closed when you leave them, and active queries can be cancelled from the UI when the database driver supports cancellation.
|
||||
|
||||
## Execution Scope
|
||||
|
||||
| Scope | How It Is Chosen | Use Case |
|
||||
|---|---|---|
|
||||
| Selected SQL | Highlight text before running | Safest option for multi-statement scratch pads |
|
||||
| Current statement | Use editor cursor workflows where available | Run one statement without selecting text manually |
|
||||
| Full editor | Run with no selection | Single-purpose query tabs and short scripts |
|
||||
|
||||
<Callout type="warn">
|
||||
DBX can execute batches and scripts, but the query editor is still safest when you run one reviewed statement at a time. Use [SQL File Execution](/en/docs/sql-file) for large `.sql` files that need progress tracking.
|
||||
</Callout>
|
||||
|
||||
## Autocomplete
|
||||
|
||||
Completion suggestions come from the active database context:
|
||||
|
|
@ -71,6 +85,7 @@ DBX records executed SQL so you can reuse it later:
|
|||
- Previous statements can be reviewed by time
|
||||
- Clicking a history item loads it back into the editor
|
||||
- Useful for investigation queries, reports, and repair statements
|
||||
- History entries preserve enough context to identify manual queries and AI-assisted work
|
||||
|
||||
<Callout type="warn">
|
||||
Query history may include business fields, table names, or filter values. Be mindful of sensitive information on shared machines or demo environments.
|
||||
|
|
@ -79,3 +94,7 @@ Query history may include business fields, table names, or filter values. Be min
|
|||
## Working With the Data Grid
|
||||
|
||||
Query results open in the [Data Grid](/en/docs/data-grid). If the result is editable, DBX shows the SQL before saving changes. For analysis-only results, you can export CSV, JSON, or Markdown.
|
||||
|
||||
## Working With AI
|
||||
|
||||
The editor can send the current SQL, active connection type, database name, recent error, result preview, and loaded schema context to the [AI Assistant](/en/docs/ai-assistant). In Ask mode, AI returns SQL and explanations only. In Agent mode, DBX applies an execution policy before attempting to run generated SQL.
|
||||
|
|
|
|||
|
|
@ -19,6 +19,16 @@ description: 使用侧边栏浏览连接、数据库、Schema、表、字段和
|
|||
|
||||
点击节点可以展开或折叠;点击表名可以打开数据浏览;字段节点会展示类型、约束和默认值等信息。
|
||||
|
||||
## 不同数据库的树结构
|
||||
|
||||
| 连接类型 | 浏览模型 |
|
||||
|---|---|
|
||||
| 关系型数据库 | 连接、数据库、Schema、表/视图、字段、索引、外键、触发器,以及可获取元数据的例程 |
|
||||
| Redis | Redis 数据库和键,并为 String、Hash、List、Set、Sorted Set、Stream 提供值编辑 |
|
||||
| MongoDB | 数据库、集合和分页文档浏览 |
|
||||
| 对象浏览器 | 在数据库支持时查看视图、存储过程和函数源码 |
|
||||
| 保存的 SQL | 侧边栏中的 SQL 文件夹和可复用 SQL 文件 |
|
||||
|
||||
## 搜索
|
||||
|
||||
侧边栏搜索用于在对象数量较多时快速定位:
|
||||
|
|
@ -84,3 +94,13 @@ Redis 连接会使用更适合键值数据的浏览方式:
|
|||
- 支持 String、Hash、List、Set、Sorted Set 和 Stream
|
||||
|
||||
Redis 键空间较大时,建议配合搜索和分页使用,避免一次性展开过多数据。
|
||||
|
||||
## 功能边界
|
||||
|
||||
| 功能 | 支持类型 |
|
||||
|---|---|
|
||||
| Schema 感知树 | PostgreSQL、SQL Server、Oracle、Redshift、DM、GaussDB、KingBase、HighGo、Vastbase、JDBC、H2、Snowflake、Trino、DB2、TDengine |
|
||||
| ER 图 | MySQL、PostgreSQL、SQLite、SQL Server、Oracle、Redshift、DM、GaussDB、KingBase、HighGo、Vastbase、GoldenDB、Access、H2、DB2 |
|
||||
| 数据库搜索 | MySQL、PostgreSQL、SQLite、SQL Server、Oracle、Redshift、DuckDB、ClickHouse、DM、GaussDB、KingBase、HighGo、Vastbase、GoldenDB、Access、H2、Snowflake、Trino、Hive、DB2、Informix、Neo4j、Cassandra、BigQuery、Kylin、SunDB、TDengine |
|
||||
|
||||
如果某个节点菜单里没有对应操作,通常说明当前数据库类型没有暴露所需元数据,或 DBX 没有足够把握生成安全 SQL。
|
||||
|
|
|
|||
|
|
@ -19,6 +19,16 @@ Connection
|
|||
|
||||
Expand or collapse nodes to drill down. Click a table to open its data. Column entries show type, constraints, defaults, and related attributes when available.
|
||||
|
||||
## Database-Specific Trees
|
||||
|
||||
| Connection Type | Browser Model |
|
||||
|---|---|
|
||||
| Relational databases | Connection, database, schema, tables/views, columns, indexes, foreign keys, triggers, and routines where metadata is available |
|
||||
| Redis | Redis databases and keys, with value editors for String, Hash, List, Set, Sorted Set, and Stream |
|
||||
| MongoDB | Databases, collections, and paginated document browsing |
|
||||
| Object browser | Views, procedures, and functions when the database exposes source metadata |
|
||||
| Saved SQL | Folders and reusable SQL files in the sidebar library |
|
||||
|
||||
## Search
|
||||
|
||||
Sidebar search helps locate objects when a connection contains many tables:
|
||||
|
|
@ -84,3 +94,13 @@ Redis connections use a browser designed for key-value data:
|
|||
- String, Hash, List, Set, Sorted Set, and Stream are supported
|
||||
|
||||
For large Redis keyspaces, use search and pagination together instead of expanding too much data at once.
|
||||
|
||||
## Feature Boundaries
|
||||
|
||||
| Feature | Supported Types |
|
||||
|---|---|
|
||||
| Schema-aware tree | PostgreSQL, SQL Server, Oracle, Redshift, DM, GaussDB, KingBase, HighGo, Vastbase, JDBC, H2, Snowflake, Trino, DB2, TDengine |
|
||||
| ER diagram | MySQL, PostgreSQL, SQLite, SQL Server, Oracle, Redshift, DM, GaussDB, KingBase, HighGo, Vastbase, GoldenDB, Access, H2, DB2 |
|
||||
| Database search | MySQL, PostgreSQL, SQLite, SQL Server, Oracle, Redshift, DuckDB, ClickHouse, DM, GaussDB, KingBase, HighGo, Vastbase, GoldenDB, Access, H2, Snowflake, Trino, Hive, DB2, Informix, Neo4j, Cassandra, BigQuery, Kylin, SunDB, TDengine |
|
||||
|
||||
If an action is missing from a node menu, the active database type may not expose the required metadata or safe SQL generation path.
|
||||
|
|
|
|||
|
|
@ -59,6 +59,10 @@ Schema 同步可能包含删除表、删除字段、修改字段类型等破坏
|
|||
当前 Schema 对比不完整覆盖外键、触发器、视图定义、字段注释,也不会检测同名索引的列或唯一性变化。重要迁移仍建议人工审查生成的 SQL。
|
||||
</Callout>
|
||||
|
||||
## 数据库覆盖范围
|
||||
|
||||
Schema 对比依赖表、字段和索引元数据。它更适合 MySQL、PostgreSQL、SQLite、SQL Server、Oracle、Redshift、DM、GaussDB 系等可以稳定读取关系结构的数据库。Redis、MongoDB、Elasticsearch 的数据模型不同,不适合作为关系型 Schema 同步目标。
|
||||
|
||||
## 执行前检查
|
||||
|
||||
同步前建议确认:
|
||||
|
|
@ -78,4 +82,7 @@ Schema 同步可能包含删除表、删除字段、修改字段类型等破坏
|
|||
<Card title="数据库导出" href="/cn/docs/database-export">
|
||||
在执行高风险同步前导出结构和数据。
|
||||
</Card>
|
||||
<Card title="数据库支持" href="/cn/docs/databases">
|
||||
查看哪些数据库支持结构相关工作流。
|
||||
</Card>
|
||||
</Cards>
|
||||
|
|
|
|||
|
|
@ -59,6 +59,10 @@ Schema sync may include destructive operations such as dropping tables, dropping
|
|||
Schema Diff currently does not fully compare foreign keys, triggers, view definitions, column comments, or changed columns/uniqueness inside an index with the same name. Important migrations still need manual SQL review.
|
||||
</Callout>
|
||||
|
||||
## Database Coverage
|
||||
|
||||
Schema Diff depends on table, column, and index metadata. It works best on relational engines where DBX can list structures consistently, such as MySQL, PostgreSQL, SQLite, SQL Server, Oracle, Redshift, DM, and GaussDB-family engines. Redis, MongoDB, and Elasticsearch use different data models and are not good targets for relational schema sync.
|
||||
|
||||
## Before Running Sync SQL
|
||||
|
||||
Before applying generated SQL, confirm:
|
||||
|
|
@ -78,4 +82,7 @@ Before applying generated SQL, confirm:
|
|||
<Card title="Database Export" href="/en/docs/database-export">
|
||||
Export structure and data before high-risk sync operations.
|
||||
</Card>
|
||||
<Card title="Database Support" href="/en/docs/databases">
|
||||
Check which engines support schema and structure workflows.
|
||||
</Card>
|
||||
</Cards>
|
||||
|
|
|
|||
|
|
@ -46,8 +46,13 @@ DBX 会按流式方式读取 SQL 文件,并尽量正确识别语句边界,
|
|||
- 字符串中的分号不会被当作语句结束
|
||||
- 行注释和块注释中的分号不会被当作语句结束
|
||||
- PostgreSQL 的 dollar-quoted 函数体会保持为同一条语句
|
||||
- SQL Server 的 `GO` 行会被识别为批次分隔
|
||||
- MySQL executable comments 会在导入前按目标连接处理:MySQL 兼容连接会展开可执行内容,非 MySQL 连接会跳过;`ENABLE/DISABLE KEYS`、`LOCK/UNLOCK TABLES`、session 状态恢复这类导入辅助指令会跳过
|
||||
|
||||
## 数据库覆盖范围
|
||||
|
||||
SQL 文件执行面向 SQL 类数据库。Redis、MongoDB 和 Elasticsearch 不执行关系型 SQL 脚本,因此 DBX 会隐藏或禁用该功能。
|
||||
|
||||
## 错误处理
|
||||
|
||||
默认情况下,执行遇到错误会停止。你也可以启用“遇错继续”,让 DBX 继续执行后续语句并记录失败数量。
|
||||
|
|
|
|||
|
|
@ -46,8 +46,13 @@ DBX reads SQL files as a stream and tries to detect statement boundaries correct
|
|||
- Semicolons inside strings are not treated as statement endings
|
||||
- Semicolons inside line and block comments are ignored
|
||||
- PostgreSQL dollar-quoted function bodies are kept together
|
||||
- SQL Server `GO` lines split batches
|
||||
- MySQL executable comments are prepared for the target connection before import: MySQL-compatible connections unwrap executable content, non-MySQL connections skip it, and import-helper directives such as `ENABLE/DISABLE KEYS`, `LOCK/UNLOCK TABLES`, and session state restores are skipped
|
||||
|
||||
## Database Coverage
|
||||
|
||||
SQL file execution is for SQL-oriented engines. DBX hides or disables it for Redis, MongoDB, and Elasticsearch because those connections do not execute relational SQL scripts.
|
||||
|
||||
## Error Handling
|
||||
|
||||
By default, execution stops when a statement fails. You can enable continue-on-error to keep running later statements while recording failures.
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ description: 通过 SSH 隧道安全连接防火墙后的数据库,支持密
|
|||
| SSH 主机 | SSH 服务器的地址 |
|
||||
| SSH 端口 | SSH 端口(默认 22) |
|
||||
| SSH 用户名 | 登录 SSH 服务器的用户名 |
|
||||
| 连接超时 | DBX 等待 SSH 连接建立的最长时间,默认 5 秒 |
|
||||
|
||||
## 认证方式
|
||||
|
||||
|
|
@ -50,3 +51,18 @@ description: 通过 SSH 隧道安全连接防火墙后的数据库,支持密
|
|||
3. DBX 通过转发的本地端口连接数据库
|
||||
|
||||
隧道在数据库连接期间保持活跃,断开连接时自动关闭。
|
||||
|
||||
## SSH、代理与文件型数据库
|
||||
|
||||
SSH 隧道适用于网络数据库。SQLite 和 Access 是文件型连接,不使用 SSH。DuckDB 通常也使用本地文件,所以只有当当前驱动类型确实需要网络端点时才需要配置 SSH。
|
||||
|
||||
如果你的网络需要代理而不是 SSH,可以使用连接窗口里的代理页签。DBX 支持 SOCKS5 和 HTTP 代理,并可选填写用户名和密码。
|
||||
|
||||
<Cards>
|
||||
<Card title="创建连接" href="/cn/docs/getting-started">
|
||||
在同一个连接窗口里配置数据库类型、SSH、代理、SSL 和连接颜色。
|
||||
</Card>
|
||||
<Card title="数据库支持" href="/cn/docs/databases">
|
||||
查看哪些数据库是文件型、原生驱动、兼容协议或插件驱动。
|
||||
</Card>
|
||||
</Cards>
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ When creating or editing a connection, enable the SSH tunnel option:
|
|||
| SSH Host | Hostname or IP of the SSH server |
|
||||
| SSH Port | Port for SSH (default: 22) |
|
||||
| SSH User | Username for SSH authentication |
|
||||
| Connect Timeout | Maximum time DBX waits while opening the SSH connection; default is 5 seconds |
|
||||
|
||||
## Authentication Methods
|
||||
|
||||
|
|
@ -50,3 +51,18 @@ By default, the SSH tunnel listens on `localhost` only. Enable LAN exposure to b
|
|||
3. Connects to the database through the forwarded local port
|
||||
|
||||
The tunnel remains active for the duration of the connection and closes automatically when you disconnect.
|
||||
|
||||
## SSH, Proxy, And File Databases
|
||||
|
||||
SSH tunnels are available for network databases. SQLite and Access connections are file-based and do not use SSH. DuckDB usually uses a local file as well, so only configure SSH when the selected driver profile actually needs a network endpoint.
|
||||
|
||||
If your network requires a proxy instead of SSH, use the connection dialog's proxy tab. DBX supports SOCKS5 and HTTP proxy settings with optional username and password.
|
||||
|
||||
<Cards>
|
||||
<Card title="Create a Connection" href="/en/docs/getting-started">
|
||||
Configure the database profile, SSH, proxy, SSL, and connection color together.
|
||||
</Card>
|
||||
<Card title="Database Support" href="/en/docs/databases">
|
||||
Check which database profiles are file-based, native, compatibility-based, or plugin-backed.
|
||||
</Card>
|
||||
</Cards>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@ description: 将 CSV、TSV、JSON 或 Excel 文件导入数据库表,并检查
|
|||
| CSV | 逗号分隔文本,适合通用数据交换 |
|
||||
| TSV | 制表符分隔文本,适合字段中包含逗号的场景 |
|
||||
| JSON | JSON 数组,适合从接口或脚本导出的数据 |
|
||||
| Excel | `.xlsx` 或 `.xls` 文件 |
|
||||
| Excel | `.xlsx`、`.xlsm` 或 `.xls` 文件;DBX 读取第一个工作表 |
|
||||
|
||||
DBX 会在导入前预览前 50 行。CSV/TSV 中的空单元格会按 `NULL` 处理。JSON 可以是单个对象、对象数组或数组行;对象行和数组行混用会被拒绝。
|
||||
|
||||
## 导入流程
|
||||
|
||||
|
|
@ -55,6 +57,20 @@ description: 将 CSV、TSV、JSON 或 Excel 文件导入数据库表,并检查
|
|||
清空后导入会删除目标表中的现有数据。生产环境使用前请确认备份和影响范围。
|
||||
</Callout>
|
||||
|
||||
导入会分批执行。默认批大小为 500 行,进度视图会显示已导入行数、总行数、错误和取消状态。
|
||||
|
||||
## 字段映射规则
|
||||
|
||||
- 先按字段名精确匹配
|
||||
- 也会按规范化名称匹配,忽略大小写、空格、下划线和连字符差异
|
||||
- 源字段可以跳过
|
||||
- 同一个目标字段不能被重复映射
|
||||
- 至少需要映射一个字段才能开始导入
|
||||
|
||||
## 数据库覆盖范围
|
||||
|
||||
表数据导入支持 MySQL、PostgreSQL、SQLite、DuckDB、ClickHouse、SQL Server、Oracle、Doris、StarRocks、Redshift、DM、GaussDB、KingBase、HighGo、Vastbase、GoldenDB 和 Access。
|
||||
|
||||
## 导入前检查
|
||||
|
||||
- 文件首行是否是列名
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@ Table Import writes a local file into a selected database table. Use it for one-
|
|||
| CSV | Comma-separated text for general data exchange |
|
||||
| TSV | Tab-separated text, useful when values contain commas |
|
||||
| JSON | JSON arrays exported from APIs or scripts |
|
||||
| Excel | `.xlsx` or `.xls` files |
|
||||
| Excel | `.xlsx`, `.xlsm`, or `.xls` files; DBX reads the first sheet |
|
||||
|
||||
DBX previews the first 50 rows before import. Empty CSV/TSV cells are treated as `NULL`. JSON imports can be a single object, an array of objects, or an array of arrays; mixed object and array rows are rejected.
|
||||
|
||||
## Import Workflow
|
||||
|
||||
|
|
@ -55,6 +57,20 @@ Table Import writes a local file into a selected database table. Use it for one-
|
|||
Truncate-then-import deletes existing rows from the target table. Confirm backups and impact before using it on production data.
|
||||
</Callout>
|
||||
|
||||
Imports run in batches. The default batch size is 500 rows, and the progress view reports imported rows, total rows, errors, and cancellation state.
|
||||
|
||||
## Column Mapping Rules
|
||||
|
||||
- Exact column names are matched first
|
||||
- Normalized names also match when spacing, underscores, hyphens, or case differ
|
||||
- A source column can be skipped
|
||||
- A target column cannot be mapped more than once
|
||||
- At least one column must be mapped before import can start
|
||||
|
||||
## Database Coverage
|
||||
|
||||
Table import is available for MySQL, PostgreSQL, SQLite, DuckDB, ClickHouse, SQL Server, Oracle, Doris, StarRocks, Redshift, DM, GaussDB, KingBase, HighGo, Vastbase, GoldenDB, and Access.
|
||||
|
||||
## Before Importing
|
||||
|
||||
- Confirm whether the first row contains column names
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ description: 可视化编辑表字段和索引,并在保存前预览 DDL。
|
|||
|
||||
表结构编辑器用于修改单张表的字段、索引和部分约束。它适合小范围结构调整,也适合在不手写 DDL 的情况下生成可审查的变更 SQL。
|
||||
|
||||
<Callout type="info">
|
||||
表结构编辑器目前面向 MySQL、PostgreSQL、SQLite 和 SQL Server 开启。其他数据库仍可能在结构浏览器中展示 DDL,但当 DBX 无法可靠生成安全变更时,不会显示可视化编辑器。
|
||||
</Callout>
|
||||
|
||||
## 可以编辑什么
|
||||
|
||||
| 对象 | 支持操作 |
|
||||
|
|
@ -51,7 +55,8 @@ description: 可视化编辑表字段和索引,并在保存前预览 DDL。
|
|||
| MySQL / MariaDB | 支持新增、删除、修改字段,以及新增/删除索引 |
|
||||
| PostgreSQL | 支持字段重命名、类型、默认值、NULL 约束和注释变更,以及新增/删除索引 |
|
||||
| SQLite | 支持新增字段、删除字段和重命名字段;更复杂的字段修改会提示无法安全处理 |
|
||||
| SQL Server / Oracle 等 | 可新增字段和索引;修改已有字段时会提示当前编辑器暂不支持 |
|
||||
| SQL Server | 支持常见单表结构操作 |
|
||||
| 其他引擎 | 当 DBX 不显示可视化编辑器时,使用生成 DDL、Schema 对比或手写 SQL |
|
||||
|
||||
## 使用建议
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ description: Edit table columns and indexes visually, then preview DDL before ap
|
|||
|
||||
The table structure editor modifies columns, indexes, and some constraints for a single table. Use it for focused structure changes or to generate reviewable DDL without writing it by hand.
|
||||
|
||||
<Callout type="info">
|
||||
The structure editor is enabled for MySQL, PostgreSQL, SQLite, and SQL Server. Other databases may still expose DDL through the schema browser, but DBX does not show the visual editor when it cannot generate safe changes.
|
||||
</Callout>
|
||||
|
||||
## What You Can Edit
|
||||
|
||||
| Object | Supported Actions |
|
||||
|
|
@ -51,7 +55,8 @@ Dropping columns, changing column types, and changing nullable constraints can a
|
|||
| MySQL / MariaDB | Add, delete, and modify columns; add and delete indexes |
|
||||
| PostgreSQL | Rename columns, change type/default/nullability/comments, and add/delete indexes |
|
||||
| SQLite | Add, delete, and rename columns; more complex existing-column edits are blocked with a warning |
|
||||
| SQL Server / Oracle and others | Adding columns and indexes is available; editing existing columns is currently blocked by the editor |
|
||||
| SQL Server | Focused editor support for common table structure operations |
|
||||
| Other engines | Use generated DDL, Schema Diff, or manual SQL when DBX does not expose the visual editor |
|
||||
|
||||
## Recommendations
|
||||
|
||||
|
|
|
|||
|
|
@ -33,8 +33,10 @@ DBX 是一个开源数据库工作台。它把日常数据库工作里的高频
|
|||
| 多数据库连接 | 支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、DuckDB、ClickHouse、SQL Server、Oracle 等数据库 |
|
||||
| SQL 编辑器 | 基于 CodeMirror 6,支持语法高亮、元数据补全、格式化、选中执行和查询历史 |
|
||||
| 数据表格 | 虚拟滚动、行内编辑、WHERE/ORDER BY 控制、SQL 预览和多格式导出 |
|
||||
| 结构工具 | 表结构编辑、Schema 对比、ER 图、字段血缘、数据库导出和 SQL 文件执行 |
|
||||
| AI 辅助 | 根据当前连接的元数据生成 SQL、解释查询、优化语句、辅助修复错误 |
|
||||
| 结构工具 | 结构浏览、表结构编辑、Schema 对比、ER 图、字段血缘、数据库导出和 SQL 文件执行 |
|
||||
| 数据流转 | 表数据导入、数据传输、SQL 文件执行,以及支持进度和取消的 SQL 导出 |
|
||||
| 专项浏览器 | Redis 键值浏览和 MongoDB 文档浏览 |
|
||||
| AI 与自动化 | 根据连接元数据生成 SQL、解释查询、优化语句、辅助修复错误,并通过 MCP 暴露连接给编程助手 |
|
||||
| 自托管访问 | Docker 版本可部署在服务器上,通过浏览器访问 DBX |
|
||||
|
||||
## 设计取向
|
||||
|
|
@ -51,7 +53,7 @@ DBX 优先覆盖数据库客户端里的核心工作流,而不是把所有数
|
|||
- 连接配置保存在本机应用数据目录的 SQLite 数据库中,密码、SSH 密码、SSH 密钥密码等敏感字段会从普通连接配置中拆出,单独存放在 `connection_secrets` 表。
|
||||
- 配置导出支持 AES-GCM 加密,适合在多台设备之间迁移连接。
|
||||
- SSH 隧道可以连接私有网络或防火墙后的数据库。
|
||||
- DBX 不会自动执行 AI 生成的 SQL;执行前仍需要用户确认。
|
||||
- AI Ask 模式不会执行生成的 SQL。Agent 和 MCP 流程会使用保守执行策略,并默认阻止危险 SQL。
|
||||
|
||||
## 下一步
|
||||
|
||||
|
|
|
|||
|
|
@ -33,8 +33,10 @@ DBX is available as both a desktop app and a Docker deployment. Use the desktop
|
|||
| Database connections | MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, ClickHouse, SQL Server, Oracle, and more |
|
||||
| SQL editor | CodeMirror 6, syntax highlighting, metadata completion, formatting, selected execution, and query history |
|
||||
| Data grid | Virtual scrolling, inline editing, WHERE/ORDER BY controls, SQL preview, and export tools |
|
||||
| Schema tools | Table structure editing, schema diff, ER diagrams, field lineage, database export, and SQL file execution |
|
||||
| AI assistance | Generate SQL, explain queries, suggest optimizations, and help fix errors using connection metadata |
|
||||
| Schema tools | Schema browser, table structure editing, schema diff, ER diagrams, field lineage, database export, and SQL file execution |
|
||||
| Data movement | Table import, data transfer, SQL file execution, and SQL export with progress and cancellation where supported |
|
||||
| Specialized browsers | Redis key/value browsing and MongoDB document browsing |
|
||||
| AI and automation | Generate SQL, explain queries, suggest optimizations, help fix errors, and expose DBX connections to coding agents through MCP |
|
||||
| Self-hosted access | Run DBX with Docker and access it from a browser |
|
||||
|
||||
## Product Principles
|
||||
|
|
@ -51,7 +53,7 @@ DBX focuses on the core work of a database client instead of turning every opera
|
|||
- Connection configuration is stored in a local SQLite database under the app data directory. Sensitive fields such as passwords, SSH passwords, SSH key passphrases, and connection strings are removed from the normal connection JSON and stored separately in the `connection_secrets` table.
|
||||
- Config export can be encrypted with AES-GCM for migration between machines.
|
||||
- SSH tunnels can connect to databases behind firewalls or private networks.
|
||||
- DBX does not automatically execute AI-generated SQL; the user still reviews and runs it.
|
||||
- AI Ask mode does not execute generated SQL. Agent and MCP flows use conservative execution policies and block dangerous SQL by default.
|
||||
|
||||
## Next Steps
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# DBX Docs MDX Code Sync Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [x]`) syntax for tracking.
|
||||
|
||||
**Goal:** Update the DBX static docs MDX pages in English and Simplified Chinese so they match the actual product behavior implemented in this repository.
|
||||
|
||||
|
|
@ -61,7 +61,7 @@
|
|||
- Read: `mcp/src/sql-safety.ts`
|
||||
- Modify: `docs/superpowers/plans/2026-05-17-docs-mdx-code-sync-plan.md`
|
||||
|
||||
- [ ] **Step 1: Extract database type and profile facts**
|
||||
- [x] **Step 1: Extract database type and profile facts**
|
||||
|
||||
Run:
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ Expected:
|
|||
- Connection profile labels, default ports, and profile-to-driver mappings.
|
||||
- A picker list that shows user-visible database choices.
|
||||
|
||||
- [ ] **Step 2: Extract feature support boundaries**
|
||||
- [x] **Step 2: Extract feature support boundaries**
|
||||
|
||||
Run:
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ Expected:
|
|||
|
||||
- Sets for schema-aware databases, SQL file unsupported types, diagrams, database search, table import, table structure, create database, field lineage, and transfer support.
|
||||
|
||||
- [ ] **Step 3: Extract workflow and safety facts**
|
||||
- [x] **Step 3: Extract workflow and safety facts**
|
||||
|
||||
Run:
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ Expected:
|
|||
|
||||
- Concrete facts for AI modes, SQL safety, SQL file splitting, import formats, transfer modes, export contents, MCP tools, and MCP safety defaults.
|
||||
|
||||
- [ ] **Step 4: Mark this task complete in this plan**
|
||||
- [x] **Step 4: Mark this task complete in this plan**
|
||||
|
||||
Edit this file and change Task 1 checkboxes to checked after facts are collected.
|
||||
|
||||
|
|
@ -130,7 +130,7 @@ Edit this file and change Task 1 checkboxes to checked after facts are collected
|
|||
- Modify: `docs/content/docs/config-export.cn.mdx`
|
||||
- Modify: `docs/superpowers/plans/2026-05-17-docs-mdx-code-sync-plan.md`
|
||||
|
||||
- [ ] **Step 1: Update Getting Started in both locales**
|
||||
- [x] **Step 1: Update Getting Started in both locales**
|
||||
|
||||
Use these facts:
|
||||
|
||||
|
|
@ -147,7 +147,7 @@ Content requirements:
|
|||
- Expand connection creation steps with URL import, SSH/proxy, file-based databases, and test/save flow.
|
||||
- Add safety notes for secrets and production connection colors.
|
||||
|
||||
- [ ] **Step 2: Update Database Support in both locales**
|
||||
- [x] **Step 2: Update Database Support in both locales**
|
||||
|
||||
Use these facts:
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ Content requirements:
|
|||
- Keep DM/ODBC notes where still relevant.
|
||||
- Add a note that feature support is intentionally database-specific.
|
||||
|
||||
- [ ] **Step 3: Update JDBC Plugin docs in both locales**
|
||||
- [x] **Step 3: Update JDBC Plugin docs in both locales**
|
||||
|
||||
Use these facts:
|
||||
|
||||
|
|
@ -182,7 +182,7 @@ Content requirements:
|
|||
- Document driver JAR import, driver class, connection test, and troubleshooting boundaries.
|
||||
- Add security and compatibility notes.
|
||||
|
||||
- [ ] **Step 4: Lightly update SSH Tunnel and Config Export in both locales**
|
||||
- [x] **Step 4: Lightly update SSH Tunnel and Config Export in both locales**
|
||||
|
||||
Use these facts:
|
||||
|
||||
|
|
@ -195,7 +195,7 @@ Content requirements:
|
|||
- Add concise boundary notes without turning these pages into internals docs.
|
||||
- Ensure links to Getting Started and Database Support are present.
|
||||
|
||||
- [ ] **Step 5: Mark this task complete in this plan**
|
||||
- [x] **Step 5: Mark this task complete in this plan**
|
||||
|
||||
Edit this file and check all Task 2 boxes after both English and Chinese files are updated.
|
||||
|
||||
|
|
@ -218,7 +218,7 @@ Edit this file and check all Task 2 boxes after both English and Chinese files a
|
|||
- Modify: `docs/content/docs/field-lineage.cn.mdx`
|
||||
- Modify: `docs/superpowers/plans/2026-05-17-docs-mdx-code-sync-plan.md`
|
||||
|
||||
- [ ] **Step 1: Update Query Editor in both locales**
|
||||
- [x] **Step 1: Update Query Editor in both locales**
|
||||
|
||||
Use these facts:
|
||||
|
||||
|
|
@ -234,7 +234,7 @@ Content requirements:
|
|||
- Link to AI Assistant and Data Grid.
|
||||
- Keep shortcut table.
|
||||
|
||||
- [ ] **Step 2: Update Data Grid in both locales**
|
||||
- [x] **Step 2: Update Data Grid in both locales**
|
||||
|
||||
Use these facts:
|
||||
|
||||
|
|
@ -247,7 +247,7 @@ Content requirements:
|
|||
- Add review-before-save behavior.
|
||||
- Add export and copy formats.
|
||||
|
||||
- [ ] **Step 3: Update Schema Browser and related schema pages in both locales**
|
||||
- [x] **Step 3: Update Schema Browser and related schema pages in both locales**
|
||||
|
||||
Use these facts:
|
||||
|
||||
|
|
@ -261,7 +261,7 @@ Content requirements:
|
|||
- Add capability boundary tables.
|
||||
- Cross-link schema diff, table structure, field lineage, database search if documented.
|
||||
|
||||
- [ ] **Step 4: Mark this task complete in this plan**
|
||||
- [x] **Step 4: Mark this task complete in this plan**
|
||||
|
||||
Edit this file and check all Task 3 boxes after updates are complete.
|
||||
|
||||
|
|
@ -284,7 +284,7 @@ Edit this file and check all Task 3 boxes after updates are complete.
|
|||
- Modify: `docs/content/docs/mcp.cn.mdx`
|
||||
- Modify: `docs/superpowers/plans/2026-05-17-docs-mdx-code-sync-plan.md`
|
||||
|
||||
- [ ] **Step 1: Update Data Transfer in both locales**
|
||||
- [x] **Step 1: Update Data Transfer in both locales**
|
||||
|
||||
Use these facts:
|
||||
|
||||
|
|
@ -298,7 +298,7 @@ Content requirements:
|
|||
- Add source/target database support boundaries.
|
||||
- Add review and cancellation notes.
|
||||
|
||||
- [ ] **Step 2: Update Table Import in both locales**
|
||||
- [x] **Step 2: Update Table Import in both locales**
|
||||
|
||||
Use these facts:
|
||||
|
||||
|
|
@ -315,7 +315,7 @@ Content requirements:
|
|||
- Add mapping rules and duplicate target column warning.
|
||||
- Add append/truncate mode safety callout.
|
||||
|
||||
- [ ] **Step 3: Update SQL File and Database Export in both locales**
|
||||
- [x] **Step 3: Update SQL File and Database Export in both locales**
|
||||
|
||||
Use these facts:
|
||||
|
||||
|
|
@ -329,7 +329,7 @@ Content requirements:
|
|||
- Add supported/unsupported database notes.
|
||||
- Add backup and import/export round-trip guidance.
|
||||
|
||||
- [ ] **Step 4: Update AI Assistant in both locales**
|
||||
- [x] **Step 4: Update AI Assistant in both locales**
|
||||
|
||||
Use these facts:
|
||||
|
||||
|
|
@ -344,7 +344,7 @@ Content requirements:
|
|||
- Add SQL safety table.
|
||||
- Add schema context and `@table` mention guidance.
|
||||
|
||||
- [ ] **Step 5: Update MCP in both locales**
|
||||
- [x] **Step 5: Update MCP in both locales**
|
||||
|
||||
Use these facts:
|
||||
|
||||
|
|
@ -360,7 +360,7 @@ Content requirements:
|
|||
- Add desktop vs web mode table.
|
||||
- Add safety environment variable section.
|
||||
|
||||
- [ ] **Step 6: Mark this task complete in this plan**
|
||||
- [x] **Step 6: Mark this task complete in this plan**
|
||||
|
||||
Edit this file and check all Task 4 boxes after updates are complete.
|
||||
|
||||
|
|
@ -376,7 +376,7 @@ Edit this file and check all Task 4 boxes after updates are complete.
|
|||
- Modify: any previously touched MDX page with broken cross-links or mismatched headings
|
||||
- Modify: `docs/superpowers/plans/2026-05-17-docs-mdx-code-sync-plan.md`
|
||||
|
||||
- [ ] **Step 1: Update What Is DBX in both locales**
|
||||
- [x] **Step 1: Update What Is DBX in both locales**
|
||||
|
||||
Use these facts:
|
||||
|
||||
|
|
@ -389,7 +389,7 @@ Content requirements:
|
|||
- Ensure feature list matches the revised core pages.
|
||||
- Keep screenshot reference intact unless broken.
|
||||
|
||||
- [ ] **Step 2: Review changelog pages without inventing releases**
|
||||
- [x] **Step 2: Review changelog pages without inventing releases**
|
||||
|
||||
Run:
|
||||
|
||||
|
|
@ -403,7 +403,7 @@ Expected:
|
|||
- If only intro wording or links need consistency fixes, edit them.
|
||||
- Do not add unreleased entries.
|
||||
|
||||
- [ ] **Step 3: Scan all MDX links for obvious locale mistakes**
|
||||
- [x] **Step 3: Scan all MDX links for obvious locale mistakes**
|
||||
|
||||
Run:
|
||||
|
||||
|
|
@ -417,7 +417,7 @@ Expected:
|
|||
- Chinese docs use `/cn/docs/...`.
|
||||
- No accidentally mixed locale links in newly edited sections.
|
||||
|
||||
- [ ] **Step 4: Mark this task complete in this plan**
|
||||
- [x] **Step 4: Mark this task complete in this plan**
|
||||
|
||||
Edit this file and check all Task 5 boxes after updates are complete.
|
||||
|
||||
|
|
@ -430,7 +430,7 @@ Edit this file and check all Task 5 boxes after updates are complete.
|
|||
- Verify: `docs/package.json`
|
||||
- Modify: `docs/superpowers/plans/2026-05-17-docs-mdx-code-sync-plan.md`
|
||||
|
||||
- [ ] **Step 1: Check bilingual page pairs exist**
|
||||
- [x] **Step 1: Check bilingual page pairs exist**
|
||||
|
||||
Run:
|
||||
|
||||
|
|
@ -462,7 +462,7 @@ NODE
|
|||
|
||||
Expected: exit code 0 and no missing page output.
|
||||
|
||||
- [ ] **Step 2: Check English/Chinese heading parity for edited page pairs**
|
||||
- [x] **Step 2: Check English/Chinese heading parity for edited page pairs**
|
||||
|
||||
Run:
|
||||
|
||||
|
|
@ -487,7 +487,7 @@ NODE
|
|||
|
||||
Expected: no output. If output appears, inspect whether the mismatch is intentional. Fix unintentional mismatches.
|
||||
|
||||
- [ ] **Step 3: Build the docs site**
|
||||
- [x] **Step 3: Build the docs site**
|
||||
|
||||
Run:
|
||||
|
||||
|
|
@ -497,7 +497,7 @@ pnpm --dir docs build
|
|||
|
||||
Expected: Next/Fumadocs build completes successfully.
|
||||
|
||||
- [ ] **Step 4: Review git diff**
|
||||
- [x] **Step 4: Review git diff**
|
||||
|
||||
Run:
|
||||
|
||||
|
|
@ -511,7 +511,7 @@ Expected:
|
|||
- Only documentation content and plan progress changed.
|
||||
- No generated cache, build output, or unrelated source changes are included.
|
||||
|
||||
- [ ] **Step 5: Commit docs content changes**
|
||||
- [x] **Step 5: Commit docs content changes**
|
||||
|
||||
Run:
|
||||
|
||||
|
|
@ -524,6 +524,6 @@ Expected:
|
|||
|
||||
- Commit succeeds with a Conventional Commit message.
|
||||
|
||||
- [ ] **Step 6: Mark this task complete in this plan**
|
||||
- [x] **Step 6: Mark this task complete in this plan**
|
||||
|
||||
If the plan file is already committed before this checkbox is marked, leave the completion status in the final response instead of making a follow-up commit only for this checkbox.
|
||||
|
|
|
|||
Loading…
Reference in New Issue