Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,36 @@ Flydb 的重要变更记录在本文件中。版本遵循语义化版本;正

## [Unreleased]

## [0.3.7] - 2026-09-08

本次重点完善本机工作台的日常使用:大变更预览更流畅,多配置更易整理,问题上下文可直接交给 Agent;修复大记录读取与迁移状态显示问题。

### 新增

- Web 配置名称旁新增“复制给 Agent”:整理脱敏配置、迁移状态与最近执行摘要,标明过期状态、未保存草稿和截断范围;剪贴板不可用时提供手动复制。
- Web 侧边栏支持分组折叠、新建、重命名、删除、拖拽排序及跨组移动配置,提供无需拖拽的移动入口;分组目录与顺序持久化,删除组只移入未分组。
- Web 迁移列表、当前项目执行记录和全部执行记录每页 10 条,顶部与底部均支持翻页、直接输入页码,后台刷新保留当前页。
- Web 高级操作支持 clean:显示生效目标和当前 schema 删除范围,要求风险勾选、输入 `CLEAN` 与最终确认;后端以五分钟单次引用绑定配置和目标,单次解除禁用保护,复用 Core clean 和执行记录,不修改配置文件。
- 随包提供独立 `flydb-analysis` Skill preview,支持离线材料的方言预检、结构漂移、依赖和引用分析;这是独立技能工作流,不代表迁移内核已交付完整影响分析引擎。

### 修复

- 修复分组新建、重命名和配置移动弹窗因内容根节点与焦点管理不兼容,导致输入框或选择框无法获得键盘焦点的问题。
- clean 确认弹窗不再因周期刷新返回内容相同的配置对象而清空输入和风险勾选;仅在配置、目标或凭据实际变化、或主动重新确认时重置。
- 大迁移预览改用只读虚拟滚动编辑器,支持全文查找、长行横向滚动和完整 SQL 下载;脚本列表分页,原始报告详情按需渲染。Web 轮询使用不含 SQL 正文的摘要,完整记录仅在打开时加载,避免反复传输和渲染大结果。
- Web 遇到 `MISSING` / `FUTURE` 时直接解释历史与本地脚本不匹配,提供连接配置入口,并明确修复历史、基线及临时测试重新开始的边界。
- 修复大迁移预览记录写入成功后因超过 8 MiB 而无法读取的问题;Run 采用文件流读取完整记录,配置登记文件继续保留大小限制。
- 修复 GUI 将 `OUT_OF_ORDER` 误标为“乱序已执行”并计入已执行数量的问题,按状态区分待执行与成功历史;当前版本包含本地缺失的成功历史,不再因 `FUTURE` / `MISSING` 而遗漏。
- 执行失败面板直接展示脱敏后的具体错误详情,无需展开原始 JSON 才能看到脚本与原因。
- Web 正确显示无法读取的执行记录:缺失的核验结果显示“未知”,缺失或无效时间的耗时显示“—”,修复中英文界面及导出报告中的 `undefined`、`NaN:NaN`;明确区分本地记录读取失败与数据库执行失败。

### 使用与升级

- 停止旧的 `flydb web`,解压新版 ZIP,保留原配置和驱动位置后用新版启动。工作台登记兼容既有 profiles.json,新增 groups 保存空分组及顺序;执行记录不迁移或自动删除。
- 执行记录列表覆盖最近 200 条,分页不代表全量历史查询;预览 SQL 完整保留,Agent 交接内容使用有界摘要。
- 版本同步为 0.3.7,MCP Adapter 独立版本仍为 0.1.0,CLI JSON 协议不变。README 更新为 GUI、CLI 与 Agent 使用场景,并保留数据库验证矩阵。
- 本轮 clean 的新增确认入口由隔离测试验证,未在用户数据库执行清理,也不新增厂商数据库认证声明。

## [0.3.6] - 2026-09-06

### 安全修复
Expand Down
87 changes: 58 additions & 29 deletions README.en.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,84 @@
English | [中文](./README.md)

<p align="center">
<img src="./docs/assets/flydb-mascot-banner.png" alt="Flydb Data Courier mascot" width="100%">
<img src="./docs/assets/flydb-mascot-banner.png" alt="Flydb Data Courier mascot" width="520">
</p>

# Flydb

**Database migrations you can see. Context your Agent can use.**

[![CI](https://github.com/zzxCoding/Flydb/actions/workflows/ci.yml/badge.svg)](https://github.com/zzxCoding/Flydb/actions/workflows/ci.yml)
[![Release](https://img.shields.io/github/v/release/zzxCoding/Flydb)](https://github.com/zzxCoding/Flydb/releases/latest)
[![License: Apache-2.0](https://img.shields.io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2Ni4xMyA5NC4wODZxLTE4LjgxIDYuNTQ0LTM2LjgzMi0xLjg5OC0xNC4yMDMtNy4wOS0yMS4zMTctMjEuMjYyIiBzdHlsZT0ic3Ryb2tlOm5vbmU7ZmlsbC1ydWxlOmV2ZW5vZGQ7ZmlsbDojZjlhZjAwO2ZpbGwtb3BhY2l0eToxIi8+PC9zdmc+)](https://linux.do)

Flydb is a versioned schema migration tool for databases with JDBC drivers: built-in dialects for mainstream databases, first-class support for Chinese Xinchuang databases, and extension to niche JDBC databases through the `DatabaseType` SPI.
[Website & demo](https://flydb.zzxcoding.dev) · [Download](https://github.com/zzxCoding/Flydb/releases/latest) · [GUI guide](./docs/getting-started/web.en.md) · [Agent setup](./flydb-skills/README.md) · [Documentation](./docs/getting-started/README.md)

Flydb helps developers and operators manage versioned database changes. Use the local GUI to organize configurations, review SQL and watch execution; use the CLI in scripts and CI; copy context to an Agent when you want help. All three entry points share the same configuration and migration engine, while the GUI and local CLI share execution records.

**Today**, Flydb 0.2 is a reliable migration runtime: commands such as `migrate`, `info`, `validate`, `baseline`, `repair`, `undo`, and `clean`, backed by concurrency locks, transaction semantics, checksum validation, and failure blocking with recovery; eight built-in dialects; and Spring Boot 2/3 starters. **The long-term direction** is a database change capability shared safely by humans and AI agents: agents decide *what* changes; Flydb guarantees *how* it changes safely. See the [roadmap](./ROADMAP.md) (in Chinese) for stage goals and current progress.
MySQL, PostgreSQL, Oracle and Chinese databases including OceanBase, TiDB, DM8, KingbaseES and openGauss. **Run with Java 8+; the GUI needs no Node.js, network access or language model.**

> **Scope boundary:** Flydb manages migration versions, execution safety, and database dialect behavior. It does not translate arbitrary vendor SQL into every database syntax. Keep separate migration directories for database families when their dialects differ; see the [multi-environment guide](./docs/getting-started/multi-environment.md#4-脚本仓库按数据库家族分目录).
![Flydb local workbench with environment groups, migration state and Agent handoff](./docs/assets/flydb-workbench.en.png)
*Actual workbench UI using fictional demonstration configurations and migration records.*

## Why Flydb
## Choose how you work

- **Xinchuang databases as first-class citizens**: DM8 (Dameng), KingbaseES, openGauss, OceanBase, and TiDB ship as built-in dialects alongside MySQL, PostgreSQL, and Oracle. The CLI never bundles vendor drivers; it resolves them from `drivers/`, the runtime classpath, or a Maven repository, which fits drivers that cannot be distributed publicly.
- **Zero-dependency Java 8 core**: `flydb-core` has no third-party runtime dependencies (enforced by Maven Enforcer) and drops into any legacy Java 8 system; Boot 3 / Java 17 environments use a separate starter.
- **Friendly to humans and agents alike**: stable exit and error codes, `--dry-run` previews, non-interactive operation; the distribution ships an Agent Skill and docs matched to the CLI version.
- **Safe defaults**: `clean` is disabled by default and needs a double opt-in; failed migrations block subsequent runs; passwords come from environment variables or password files, never commands, logs, or SQL.
| Your workflow | What Flydb provides |
|---|---|
| Manage development, staging and production configurations | Collapsible groups, drag-and-drop organization, forms and an advanced editor for the original files |
| Review an upgrade before applying it | SQL previews, version search, pagination, full-text search and complete SQL downloads |
| Follow execution and diagnose failures | Script progress, transaction outcomes and post-run verification; unknown outcomes stay explicit |
| Bring in an Agent | “Copy for Agent” packages redacted settings, migration state and recent errors; Skills, JSON and MCP offer further integration |
| Automate migrations in an application or pipeline | CLI for CI, a Java API and Spring Boot 2/3 starters sharing the same engine |

## Quick start
## Open the GUI with one command

Prerequisites: Java 8 or newer, an existing target database, and a Java 8-compatible JDBC driver.
Download the ZIP from [Releases](https://github.com/zzxCoding/Flydb/releases/latest), extract it and run:

```bash
curl -LO https://github.com/zzxCoding/Flydb/releases/download/v0.3.6/flydb-cli-0.3.6.zip
unzip flydb-cli-0.3.6.zip
cd flydb-cli-0.3.6
cd flydb-cli-0.3.7
bin/flydb web
```

# Example: place mysql-connector-j.jar into drivers/
cp /path/to/mysql-connector-j.jar drivers/
On Windows, use `bin\flydb.bat web`. Import an existing `flydb.conf` or create a configuration in the browser, then provide the JDBC driver for your database. No account setup; Chinese / English and light / dark themes are included. Starting the workbench does not run migrations.

Open an existing configuration directly:

```bash
bin/flydb --config /path/to/project/flydb.conf web
```

See the [GUI guide](./docs/getting-started/web.en.md). Vendor JDBC drivers are supplied by the user under their respective licenses, not bundled in the ZIP.

<details>
<summary><strong>Prefer a terminal? Start with the CLI</strong></summary>

bin/flydb init \
--url 'jdbc:mysql://127.0.0.1:3306/demo' \
--user flydb_user \
--database-type mysql \
--yes
For an existing MySQL database:

```bash
cp /path/to/mysql-connector-j.jar drivers/
bin/flydb init --url 'jdbc:mysql://127.0.0.1:3306/demo' --user flydb_user --database-type mysql --yes
export FLYDB_PASSWORD='replace-me'
bin/flydb validate
bin/flydb --dry-run migrate
# Review the SQL and target before applying
bin/flydb migrate
bin/flydb info
bin/flydb validate
```

`init` generates `flydb.conf`, `db/migration/V1__init.sql`, and `drivers/README.md`, and never overwrites existing files. Passwords can also be supplied through `flydb.password=${env:DB_PASSWORD}` or `flydb.password.file=/run/secrets/db_password`; a plaintext `flydb.password` is only recommended for local throwaway testing.
`init` generates `flydb.conf`, `db/migration/V1__init.sql` and `drivers/README.md`, refusing to overwrite existing files. The V1 sample contains `SELECT 1;`; replace it with your actual changes. Environment variables and password files are also supported.

</details>

## One migration engine across every entry point

- **Review before execution**: checksum validation, concurrency locks, transaction handling and failure blocking. Changes to configuration or scripts after a preview are rechecked.
- **Fit existing environments**: a Java 8 core with zero third-party runtime dependencies, a standalone CLI ZIP, and Spring Boot 2/3 starters.
- **Work across database families**: built-in dialects and driver loading, extensible through `DatabaseType` SPI. Verification levels are documented below.
- **Share facts with your Agent**: structured JSON, Plan Artifacts and execution records. Unknown or interrupted migrations are never automatically replayed. GUI clean requires risk acknowledgment and typing `CLEAN`.

Flydb manages migration workflow and database dialect behavior. It does not translate arbitrary vendor SQL into other database syntaxes; keep separate migration directories where dialects differ.

## Database support

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

- [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
- [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)
- [x] **Agent distribution**: an MCP adapter (TypeScript, nine domain tools, writes unregistered by default) plus the Plan Artifact v1 plan digest; the npm package ships with the next release
- [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
- [x] **Local workbench**: multiple configurations, groups, migration previews, execution records and Agent handoff
- [ ] **Brownfield change intelligence**: impact analysis, application reference scanning, coverage with explicit unknowns
- [ ] **Agent-safe change runtime**: a Plan → Validate → Risk → Approval → Apply → Verify protocol

Expand Down Expand Up @@ -114,7 +143,7 @@ Plain Java applications depend on `flydb-core`:
<dependency>
<groupId>io.github.zzxcoding</groupId>
<artifactId>flydb-core</artifactId>
<version>0.3.6</version>
<version>0.3.7</version>
</dependency>
```

Expand All @@ -125,13 +154,13 @@ Spring Boot applications pick the matching starter; it runs `migrate` during con
<dependency>
<groupId>io.github.zzxcoding</groupId>
<artifactId>flydb-spring-boot-3-starter</artifactId>
<version>0.3.6</version>
<version>0.3.7</version>
</dependency>
<!-- Spring Boot 2.7 / Java 8 -->
<dependency>
<groupId>io.github.zzxcoding</groupId>
<artifactId>flydb-spring-boot-2-starter</artifactId>
<version>0.3.6</version>
<version>0.3.7</version>
</dependency>
```

Expand Down Expand Up @@ -175,7 +204,7 @@ The full reactor, including the Boot 3 modules, is built with Java 17; the Boot
./mvnw verify
```

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

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`.

Expand Down
Loading
Loading