项目状态
Graft 仍然是实验性项目。本文档以 v0.8.0 release 为基线,重点是 SQLite 应用状态版本管理:SQLite snapshot、应用文件、 row-aware diff、merge 和 remote sync。
只存在于开发分支的能力不属于 v0.8.0 文档,除非页面明确标注为未发布。
- CLI:
init、clone、sql、status、audit、gc、ls-files、payload、config、add、rm、commit、log、show、diff、checkout、restore、export、reset、branch、switch、tag、merge、conflicts、resolve、remote、ls-remote、fetch、pull和push。 - SQLite 扩展:提供可选 Graft VFS、version 和低层
graft_debug_*diagnostics。 .graft/下的项目本地仓库状态。- 一个 worktree 中跟踪多个 SQLite 数据库路径。
- 与 SQLite snapshot 在同一个 commit tree 中的 text/binary file artifact。
- binary file 和配置路径的 external payload。
- 普通 rowid table 和声明主键的
WITHOUT ROWIDtable 的行级 diff、row-aware merge 和逐行 resolution,包括STRICT与复合主键 schema。 - 面向应用的 JSON 输出。
fs://、s3://、s3_compatible://和graft+http(s)://remotes。- 可连接实现 Graft HTTP remote protocol 服务的 HTTP remote client。
面向外部的主要表面是 repository-mode CLI、配置项和 JSON 输出。项目实验阶段 这些仍可能变化,但文档围绕这些表面组织。
以下内容属于实现细节:
- storage LSN
- page 和 segment 布局
- debug pragmas
- object serialization
- Rust 内部模块边界
Internals 文档用于贡献者和高级调试,不是产品级 API 保证。
SQLite Compatibility
Section titled “SQLite Compatibility”默认 worktree 使用普通 SQLite 文件。外部工具 commit transaction 后,直接运行
graft add 即可;staging snapshot 会包含 committed WAL frames,不需要手动
checkpoint。
sqlite3 data.sqlite "INSERT INTO notes(body) VALUES ('hello');"graft add data.sqlitecheckout、switch、restore 或 hard reset 需要替换数据库文件时,应先关闭相关 connection。Graft 不会在另一个 writer 活跃时覆盖数据库。
Release
Section titled “Release”预构建 CLI 和 SQLite extension archive 随 v0.8.0 GitHub release 发布。
这个仓库是 orbitinghail/graft 的 实验性 fork,把上游的 storage foundation 应用到 SQLite app-state versioning。