What Is Graft
Think of Graft as Git for SQLite. It adds the database semantics that Git lacks: storage-efficient snapshots, schema-aware merges, and row-level diffs.
Graft uses a familiar Git-like workflow with its own repository and remote formats.
The problem
Section titled “The problem”A custom diff driver can render a .sqlite file as readable text for review.
Git’s storage and merge still operate on one binary file, with no native model
for SQLite pages, schemas, tables, or rows.
That leaves three database-specific gaps:
- Storage: capture a consistent database state, including committed WAL frames, and address changed chunks independently of a whole-file blob.
- Diff: explain changes in terms of schemas, tables, and rows instead of only changed file bytes.
- Merge: combine compatible schema and row changes, then expose precise conflicts when automatic merge is unsafe.
Graft implements those SQLite-aware operations behind familiar commits, branches, restore, and remotes. The worktree still contains ordinary SQLite files, so applications keep using their existing SQLite libraries.
Graft can also version files that belong with the database:
app-data/ data.sqlite settings.json attachments/ invoice.pdfA row in data.sqlite may refer to attachments/invoice.pdf. Restoring,
branching, or synchronizing only one of those paths can produce a state the
application cannot use.
Graft records the selected databases and files in one repository commit, so a database row and the file it references can move through history together.
What Graft adds
Section titled “What Graft adds”- storage-efficient SQLite snapshots, including committed WAL frames;
- schema-, table-, row-, and path-level diffs;
- schema-aware three-way merge and structured row conflicts;
- immutable commits, branches, restore, and remote sync;
- local, object-storage, and HTTP remotes;
- structured CLI output and an in-process Node.js SDK.
Where it fits
Section titled “Where it fits”Use Graft when your application needs user-visible history, checkpoints, change review, branch-like workflows, recovery, or synchronization for a set of related databases and files.
Graft does not replace:
- SQLite transactions;
- application authentication or authorization;
- real-time operation-log replication;
- a general source-code repository;
- a separate backup and retention policy.
Developer surfaces
Section titled “Developer surfaces”| Surface | Use it for |
|---|---|
| Graft CLI | Evaluation, scripts, automation, and JSON subprocess integration. |
| Node.js SDK | Resident in-process repository sessions. |
| Remote packages | Authenticated HTTP synchronization through infrastructure you operate. |
Continue with Choose An Integration.