Skip to content

Commit 2bc2ac3

Browse files
committed
release: prepare Flydb 0.3.9
1 parent 401e754 commit 2bc2ac3

71 files changed

Lines changed: 1822 additions & 285 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CHANGELOG.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ Flydb 的重要变更记录在本文件中。版本遵循语义化版本;正
55

66
## [Unreleased]
77

8+
## [0.3.9] - 2026-11-26
9+
10+
### 新增与改进
11+
12+
- 工作台支持按用途或键名检索全部配置,集中查看已指定项、实际生效值及其来源,并汇总环境变量覆盖和影响执行的迁移开关。可批量编辑后保存,复制环境只需填写差异。
13+
- 配置表单提供填写说明和示例,开关和发布模式可按选项含义选择。直接编辑配置文件时,光标所在行也会显示对应说明。
14+
- 在工作台的「迁移」页点击「新建 SQL 脚本」,或使用 `flydb new`,都可根据已有脚本创建下一份版本化 SQL,支持显式指定版本和目录。文件系统和 classpath 的脚本发现均采用配置中的前缀、分隔符和后缀。
15+
- `flydb preflight` 和 MCP 的 `flydb_preflight` 在一次只读检查中返回校验结果、目标、脚本和语句数、计划 ID 和本机详情路径。MCP Adapter 0.2.0 按 CLI 握手版本注册新工具。
16+
- CLI 和本机 Web 支持环境文件导入共享配置。Web 复制时可填写差异、选择跟随源文件,预演时可选择本次发布的 SQL 目录。
17+
818
## [0.3.8] - 2026-10-21
919

1020
### 修复

‎README.en.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ MySQL, PostgreSQL, Oracle and Chinese databases including OceanBase, TiDB, DM8,
3737
Download the ZIP from [Releases](https://github.com/zzxCoding/Flydb/releases/latest), extract it and run:
3838

3939
```bash
40-
cd flydb-cli-0.3.8
40+
cd flydb-cli-0.3.9
4141
bin/flydb web
4242
```
4343

@@ -100,7 +100,7 @@ See the [database getting-started guides](./docs/getting-started/README.md) for
100100

101101
- [x] **Reliable migration runtime**: engine, 8 built-in dialects, CLI, Spring Boot starters, Agent Skill, the `v0.2.0` GitHub Release, and the `v0.2.1` Maven Central publishing
102102
- [x] **DX and machine contract**: `--json` machine-readable output, protocolVersion contract versioning, CI integration docs, an Agent Plugins 1.0 package (`v0.3.0`; package managers and a Docker image on demand)
103-
- [x] **Agent distribution**: an MCP adapter (TypeScript, nine domain tools, writes unregistered by default) plus the Plan Artifact v1 plan digest; a built adapter ships in the CLI ZIP
103+
- [x] **Agent distribution**: an MCP adapter (TypeScript, version-aware domain tools, writes unregistered by default) plus the Plan Artifact v1 plan digest; a built adapter ships in the CLI ZIP
104104
- [x] **Local workbench**: multiple configurations, groups, migration previews, execution records and Agent handoff
105105
- [ ] **Brownfield change intelligence**: impact analysis, application reference scanning, coverage with explicit unknowns
106106
- [ ] **Agent-safe change runtime**: a Plan → Validate → Risk → Approval → Apply → Verify protocol
@@ -143,7 +143,7 @@ Plain Java applications depend on `flydb-core`:
143143
<dependency>
144144
<groupId>io.github.zzxcoding</groupId>
145145
<artifactId>flydb-core</artifactId>
146-
<version>0.3.8</version>
146+
<version>0.3.9</version>
147147
</dependency>
148148
```
149149

@@ -154,13 +154,13 @@ Spring Boot applications pick the matching starter; it runs `migrate` during con
154154
<dependency>
155155
<groupId>io.github.zzxcoding</groupId>
156156
<artifactId>flydb-spring-boot-3-starter</artifactId>
157-
<version>0.3.8</version>
157+
<version>0.3.9</version>
158158
</dependency>
159159
<!-- Spring Boot 2.7 / Java 8 -->
160160
<dependency>
161161
<groupId>io.github.zzxcoding</groupId>
162162
<artifactId>flydb-spring-boot-2-starter</artifactId>
163-
<version>0.3.8</version>
163+
<version>0.3.9</version>
164164
</dependency>
165165
```
166166

@@ -204,7 +204,7 @@ The full reactor, including the Boot 3 modules, is built with Java 17; the Boot
204204
./mvnw verify
205205
```
206206

207-
The CLI distribution is generated at `flydb-cli/target/flydb-cli-0.3.8.zip`. The core module enforces an 80% JaCoCo line-coverage gate and zero non-test runtime dependencies via Maven Enforcer.
207+
The CLI distribution is generated at `flydb-cli/target/flydb-cli-0.3.9.zip`. The core module enforces an 80% JaCoCo line-coverage gate and zero non-test runtime dependencies via Maven Enforcer.
208208

209209
Database integration contracts are skipped by default. Set `-Pmysql`/`-Ppostgresql` and `-Dflydb.integration.database=<dialect>` explicitly to start temporary databases and run the selected tests. The full matrix runs in `.github/workflows/ci.yml`.
210210

‎README.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Flydb 是给开发、运维和实施人员使用的数据库版本迁移工具
3737
从 [Releases](https://github.com/zzxCoding/Flydb/releases/latest) 下载 ZIP,解压后运行:
3838

3939
```bash
40-
cd flydb-cli-0.3.8
40+
cd flydb-cli-0.3.9
4141
bin/flydb web
4242
```
4343

@@ -100,7 +100,7 @@ Flydb 管理迁移流程与数据库方言行为,不会把任意厂商 SQL 自
100100

101101
- [x] **可靠的迁移运行时**:迁移引擎、8 个内置方言、CLI、Spring Boot starter、Agent Skill、`v0.2.0` GitHub Release、`v0.2.1` Maven Central 发布
102102
- [x] **开发体验与机器契约**:`--json` 机器输出、protocolVersion 契约版本化、CI 接入文档、Agent Plugins 1.0 插件包(`v0.3.0`;包管理器与 Docker 镜像按需启动)
103-
- [x] **Agent 分发**:MCP 适配(TypeScript Adapter + 九个领域工具,写入默认不注册)与 Plan Artifact v1 计划摘要;CLI ZIP 内附已构建 Adapter
103+
- [x] **Agent 分发**:MCP 适配(TypeScript Adapter,按 CLI 版本注册领域工具,写入默认不注册)与 Plan Artifact v1 计划摘要;CLI ZIP 内附已构建 Adapter
104104
- [x] **本机图形工作台**:多配置、分组、迁移预览、执行记录与 Agent 上下文交接
105105
- [ ] **存量变更智能**:影响分析、应用引用扫描、覆盖率与未知项标注
106106
- [ ] **Agent 安全变更运行时**:Plan → Validate → Risk → Approval → Apply → Verify 协议
@@ -143,7 +143,7 @@ flydb.migrate();
143143
<dependency>
144144
<groupId>io.github.zzxcoding</groupId>
145145
<artifactId>flydb-core</artifactId>
146-
<version>0.3.8</version>
146+
<version>0.3.9</version>
147147
</dependency>
148148
```
149149

@@ -154,13 +154,13 @@ Spring Boot 应用选择对应 starter,容器初始化期间执行 `migrate`
154154
<dependency>
155155
<groupId>io.github.zzxcoding</groupId>
156156
<artifactId>flydb-spring-boot-3-starter</artifactId>
157-
<version>0.3.8</version>
157+
<version>0.3.9</version>
158158
</dependency>
159159
<!-- Spring Boot 2.7 / Java 8 -->
160160
<dependency>
161161
<groupId>io.github.zzxcoding</groupId>
162162
<artifactId>flydb-spring-boot-2-starter</artifactId>
163-
<version>0.3.8</version>
163+
<version>0.3.9</version>
164164
</dependency>
165165
```
166166

@@ -204,7 +204,7 @@ bin/flydb clean --clean-disabled=false --force # clean 默认禁用;非交
204204
./mvnw verify
205205
```
206206

207-
CLI 构建产物位于 `flydb-cli/target/flydb-cli-0.3.8.zip`。core 的 JaCoCo 行覆盖率门禁为 80%,并由 Maven Enforcer 保证零非测试运行时依赖。
207+
CLI 构建产物位于 `flydb-cli/target/flydb-cli-0.3.9.zip`。core 的 JaCoCo 行覆盖率门禁为 80%,并由 Maven Enforcer 保证零非测试运行时依赖。
208208

209209
数据库集成契约默认跳过;显式设置 `-Pmysql`/`-Ppostgresql` 与 `-Dflydb.integration.database=<dialect>` 后,才会启动临时数据库执行对应测试。完整矩阵由 `.github/workflows/ci.yml` 执行。
210210

‎ROADMAP.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,18 @@
6565
这是单纯的本机 GUI:不做账户、登录页、角色权限、团队或审批管理。设计、范围和
6666
验收记录见 [Web 工作台设计](docs/design/12-web-workbench.md)。用户验收通过,纳入 0.3.5 发布。
6767

68+
## 0.3.9 开发体验(本地验证)
69+
70+
- [x] 0.3.9 开发版提供离线 `flydb new` 命令,按项目已有的迁移目录和命名规则创建版本化 SQL 文件。能推算时建议下一版本,存在歧义时支持显式指定,创建前检查版本冲突。
71+
72+
- [x] 允许环境文件导入项目配置,Web 复制时直接填写差异,也可选择跟随源配置的后续改动。
73+
- [x] 每次发布可选解压后的 SQL 目录,执行引用预演所用目录,无需修改环境文件。
74+
- [x] Agent 可用一次 `preflight` 或 `flydb_preflight` 获得内置校验结果、计划摘要与完整详情路径。
75+
76+
2026-11-26 使用本机 Docker MySQL 8.4.4 验证。开发库与测试库共用账号及密码文件,切环境仅覆盖 JDBC URL。测试库先后应用包含 V1、V1+V2 的两个发布目录,配置文件修订号一致。单脚本预演以相同工作目录、驱动、目标和脚本对照,预热后取三次中位数,0.3.8 两个 CLI 进程合计 0.90 秒,0.3.9 一个进程 0.48 秒。该计时范围为本机 CLI,未包含内网时延或模型响应时间。
77+
78+
实测入口为解压发行包的 `flydb-cli-0.3.9/bin/flydb`,目标为回环地址上的临时库 `flydb_dev` 与 `flydb_qa`。先执行 `--json version`、`-c <环境文件> validate` 和 `-c <环境文件> --dry-run migrate`。开发库执行 CLI `migrate`,测试库通过 Web 的 planId 确认执行,两库写后校验通过。成功 CLI 命令均返回 0。开发库写后第一次复查遇到短暂连接失败,重新读取确认已执行 V1,未重放写入。单独修改已执行脚本后,`preflight` 返回非零及校验问题列表;恢复脚本后,随包 MCP 读取到通过的校验结果和零待执行脚本。
79+
6880
## 阶段四:存量变更智能(0.4.0 起)
6981

7082
回答“改这个字段,究竟会伤到什么”。针对运行多年、依赖散落在数据库对象与应用代码里的存量系统。

‎docs/getting-started/mcp-adapter.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## 前置条件
66

77
1. Node.js ≥ 20(仅 MCP 宿主侧需要;普通 CLI/starter 用户不需要);
8-
2. Flydb CLI ≥ 0.3.0 发行包(含 Java 8+ 运行时);
8+
2. 安装 Flydb CLI ≥ 0.3.0,并准备 Java 8+ 运行时;
99
3. 目标数据库的 JDBC 驱动已放入发行包 `drivers/`(MCP 调用期间不联网下载驱动)。
1010

1111
## 安装方式
@@ -49,10 +49,10 @@ npx flydb-mcp # 一次性启动(发布后可用;registry 名称以发
4949
"mcpServers": {
5050
"flydb": {
5151
"type": "stdio",
52-
"command": "npx",
53-
"args": ["flydb-mcp"],
52+
"command": "node",
53+
"args": ["/opt/flydb-cli-0.3.9/flydb-skills/mcp/dist/server.mjs"],
5454
"env": {
55-
"FLYDB_CLI": "/opt/flydb-cli-0.3.8/bin/flydb",
55+
"FLYDB_CLI": "/opt/flydb-cli-0.3.9/bin/flydb",
5656
"FLYDB_PASSWORD": "由宿主 secret 注入"
5757
}
5858
}
@@ -65,8 +65,8 @@ npx flydb-mcp # 一次性启动(发布后可用;registry 名称以发
6565
## 验证安装
6666

6767
1. 宿主连接后执行 `flydb_version`:应返回 `structuredContent.version ≥ 0.3.0`;
68-
2. 执行 `flydb_info` / `flydb_validate`(传入项目绝对 `workingDirectory` 与 `configPath`)确认只读链路;
69-
3. `tools/list` 默认只有 5 个只读工具;看不到 `flydb_migrate` 等写入工具是**预期行为**。
68+
2. 查看 `tools/list`。0.3.9 发行包内置 Adapter 0.2.0,默认列出 6 个只读工具。更换发行包后重新连接 MCP 宿主以刷新清单。
69+
3. 传入项目绝对路径 `workingDirectory` 和环境文件绝对路径 `configPath`,调用 `flydb_preflight`。成功信封的 `validation` 为 `PASSED`,`plan` 给出脚本数、语句数和计划 ID。需要逐条 SQL 时读取 Adapter 所在机器的 `detailsFile`。该字段为空或客户端无法访问此路径时,调用 `flydb_plan_migrate` 获取明细。旧版组合只有原先 5 个只读工具,可依次使用 `flydb_validate` 和 `flydb_plan_migrate`。
7070

7171
## 开启写入工具(安装时知情决策)
7272

‎docs/getting-started/multi-environment.md‎

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
# 多数据库多环境自动化
22

3-
面向需要用 Flydb CLI 同时管理多个数据库家族、多套测试与生产环境的开发和运维人员。Flydb 0.2 没有内置的环境 profile 机制,本文给出一套完全基于现有 CLI 契约的组织模式:**一个数据库×环境一份 `flydb.conf`,密码全部外部注入,所有环境执行同一套命令序列**。配置键、命令参数和错误码以[配置项参考](../reference/configuration.md)、[CLI 命令参考](../reference/commands.md)和[错误码参考](../reference/errors.md)为准,本文不重复维护。
3+
面向需要用 Flydb CLI 同时管理多个数据库家族、多套测试与生产环境的开发和运维人员。Flydb 0.3.9 起可以用共享配置承载项目约定,每个环境只保存差异。旧版 CLI 可继续使用独立配置文件。配置键、命令参数和错误码以[配置项参考](../reference/configuration.md)、[CLI 命令参考](../reference/commands.md)和[错误码参考](../reference/errors.md)为准,本文不重复维护。
4+
5+
## 共享项目配置与环境差异(0.3.9+)
6+
7+
在 `deploy/project.conf` 维护共用的脚本目录、数据库家族、驱动和命名规则。例如:
8+
9+
```properties
10+
flydb.database-type=mysql
11+
flydb.locations=filesystem:db/migration
12+
flydb.user=flydb_ddl
13+
```
14+
15+
在同目录创建 `qa.conf`,只写测试环境需要覆盖的字段:
16+
17+
```properties
18+
flydb.config-import=project.conf
19+
flydb.url=jdbc:mysql://qa.example.com/app
20+
flydb.password=${env:QA_DB_PASSWORD}
21+
```
22+
23+
从项目根目录执行 `bin/flydb -c deploy/qa.conf --json preflight`。更换发布包时可临时传 `--locations filesystem:releases/v2/sql`,Web 中可直接选择解压后的 SQL 目录。相对脚本路径沿用项目工作目录。保留已执行的脚本,供历史校验核对。
24+
25+
在 Web 的「复制配置」中修改有差异的字段。勾选「跟随源配置的后续更改」会写入导入路径和覆盖值;其余字段随源配置更新,包括连接和凭据。保留独立副本可继续沿用原有文件布局。环境标签只用于显示。
426

527
## 1. 总体模式
628

@@ -12,7 +34,7 @@
1234
| `FLYDB_*` 环境变量 | 优先级高于 `flydb.conf`,用于注入密码等环境差异 |
1335
| 稳定退出码 | CI 按校验失败、锁冲突、配置错误等类别分流处理 |
1436

15-
配置优先级统一为 `CLI 参数 > FLYDB_* 环境变量 > flydb.conf > 内置默认值`。
37+
单文件配置的优先级为 `CLI 参数 > FLYDB_* 环境变量 > flydb.conf > 内置默认值`。
1638

1739
## 2. 配置组织:一个数据库×环境一份 flydb.conf
1840

‎docs/getting-started/web.en.md‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,17 @@ identify configurations; labels do not grant permissions. Duplication creates a
3232
overwrites an existing destination. Removing an entry preserves its configuration and SQL files.
3333
Discovery is bounded; select uncovered subdirectories separately when the result reports limits.
3434

35-
**Connection & settings** provides common connection fields, editable JDBC URLs, migration locations,
36-
password references and all advanced configuration keys. Special vendor URLs remain directly editable.
35+
Open **Connection & settings** for an existing environment. **Configured** shows settings supplied by its file, shared files and environment variables. Each row shows the effective value, its source and the value to write to the file. Imported settings identify the supplying file and environment overrides identify the variable. When duplicating a configuration, the middle column shows the source environment.
36+
37+
**Review first** collects environment overrides, a missing connection URL and enabled clean, out-of-order or automatic baseline behavior, as well as disabled pre-migration validation. It uses the saved configuration. Search all settings by purpose or key, including optional settings absent from the file. Edit multiple rows and save once. Browsing leaves defaults implicit.
38+
39+
Every built-in setting has inline guidance. Paths, versions and patterns include example values. Switches and release modes have labeled choices and accept environment references through the manual entry option. To include descendants of the end version, search for `family-range`, choose it under **Version selection mode**, then set a start or end version. In the file editor, select a setting’s line to see the same guidance.
40+
41+
New configurations open the **Connection form** with connection fields, editable JDBC URLs, migration locations and password references.
3742
Both creation and connection settings offer **Oracle**, with port 1521 and a Service name/SID selector.
3843
Existing simple Oracle service/SID URLs populate the form; TNS descriptors and multi-address URLs stay
3944
in direct-edit mode. Formats follow the [Oracle JDBC documentation](https://docs.oracle.com/en/database/oracle/oracle-database/19/jjdbc/data-sources-and-URLs.html).
4045
Configuration precedence and options are exactly those of the [CLI reference](../reference/configuration.md).
41-
Expand effective configuration to see the actual values and their sources.
4246

4347
Place an independently obtained, licensed JDBC JAR in the distribution's `drivers/`, or select an
4448
existing driver directory in **Edit name & group**. Maven coordinates, enterprise settings, local
@@ -57,6 +61,12 @@ still prevents overwriting the newer file. Switching language preserves drafts.
5761

5862
## Inspect, preview, execute
5963

64+
The SQL directory selector shows the scripts used for comparison with the current database. Expand the directory name to see its full path. Choosing a directory runs a read-only status check. If the database has applied V1 and V2 and the selected directory only contains V1, the table still shows V2 from database history. Select a directory containing the original V2 to check it again.
65+
66+
On the Migrations tab, select **New SQL script**, check the directory, enter a change name and select **Create empty script**. If the selected directory contains V1 and V2, entering `add_order_note` creates `V3__add_order_note.sql`. Open the displayed path in your editor, save the SQL and return to preview the migration.
67+
68+
The workbench shares the offline naming rules of `flydb new`. Choose the project directory with the full script history when authoring the next version. Expand **Specify a version or directory** for date-based versions or multiple migration directories.
69+
6070
### Form and complete-file editing
6171

6272
Both creation and connection settings offer **Form editor / File editor**. Common fields and additional

0 commit comments

Comments
 (0)