Git for SQLite.
Try the Playground · Documentation · Releases · 简体中文
Git tracks a SQLite database as an opaque binary file. Graft adds storage-efficient snapshots, schema-aware merges, and row-level diffs while keeping the worktree as ordinary SQLite files.
A custom diff driver can render a readable view of data.sqlite for review.
Git's storage and merge still operate at the file level, leaving SQLite
storage, schemas, and rows invisible.
Graft adds those database semantics:
- Consistent snapshots, including committed WAL frames
- Content-addressed chunks that reuse unchanged SQLite content across versions
- Schema-, table-, and row-level diffs and merges
- Git-like commits, branches, tags, restore, and remote sync
Related files can be recorded in the same commit as the database:
app-data/
data.sqlite
settings.json
attachments/
Graft uses a familiar Git-like workflow with its own repository and remote formats.
The Graft Playground runs the real CLI in your browser. It is the fastest way to explore commits, branches, row-level diffs, and conflicts without installing anything.
Install the latest release on macOS or Linux:
curl -fsSL https://graft.eidos.space/install.sh | shCreate a repository and save a SQLite database:
mkdir graft-demo
cd graft-demo
graft init
graft sql --db data.sqlite \
"CREATE TABLE notes(id INTEGER PRIMARY KEY, body TEXT NOT NULL);"
graft sql --db data.sqlite \
"INSERT INTO notes(body) VALUES ('first note');"
graft add --all
graft commit -m "Save initial state"
graft logContinue with the CLI quickstart.
| Integration | Use it for |
|---|---|
| CLI | Evaluation, scripts, agents, and one-shot commands |
| Structured JSON output | Stable application and automation boundaries |
| Node.js SDK | Long-lived, in-process repository sessions |
| Remote service packages | Hosting the Graft HTTP remote protocol |
Install the Node.js SDK with:
pnpm add @eidos.space/graftEidos Lite is a local-first desktop
app for .eidos relational spreadsheets and ordinary files. It uses Graft to:
- Record an entire local workspace as one version
- Show file changes and row-level SQLite changes before saving
- Inspect and restore earlier versions without rewriting history
- Synchronize workspace history through optional Eidos Sync
The integration is open source in the Eidos repository.
Using Graft in a product? Open a pull request to add it here.
- Your application writes ordinary SQLite databases and files.
graft addcaptures a consistent snapshot and stages related paths.graft commitrecords them as one application state.- Diff, branch, merge, restore, and sync operate on that history.
A repository stores its history in .graft/ beside the normal worktree.
Applications keep using their existing SQLite library and file APIs.
Graft is experimental. The CLI, structured output, Node.js SDK, and remote protocol are supported integration surfaces. Storage layouts and internal Rust modules remain implementation details.
Graft complements SQLite transactions; it does not replace application authorization, real-time replication, or Git source control.
See CONTRIBUTING.md for the full workflow.
cargo check --workspace --all-targets
just test
pnpm check:remote
pnpm test:remoteThe implementation-aligned specifications live in
docs/specs.
Graft began as a fork of orbitinghail/graft. Its original transactional storage engine now powers this project's SQLite storage layer. This repository is independently maintained and is no longer a GitHub fork.
Licensed under either the Apache License 2.0 or the MIT License, at your option.