One database per branch
Your code has branches. So does your database.
kling db branch -golden crm-demo # current branch: creates its copykling db branch hook install # every git checkout switches databasekling db branch -ls # branches with their copy, state and last usekling db branch -prune # deletes those of branches that no longer existThe connection is written to .git/kling-db.env (0600), never to the working tree:
set -a; . "$(git rev-parse --absolute-git-dir)/kling-db.env"; set +aHow long a git checkout takes
Section titled “How long a git checkout takes”Measured end to end, N = 20, hook included.
| Linux (i7-8700T) | macOS (M4, vz) | |
|---|---|---|
| back to a branch with a copy | 43 ms p50 | 322 ms p50 |
| new branch, parent reserve ready | 88 ms p50 | 348 ms p50 |
| new branch, parent changed | 2,200 ms p50 | 731 ms p50 |
Branches nobody uses are frozen in the background: 0 RAM.
In the repo: docs/db.md: one database per branch · raw data