Skip to content

Commit fa9475f

Browse files
committed
docs: FS based snapshots
1 parent 5697508 commit fa9475f

1 file changed

Lines changed: 32 additions & 1 deletion

File tree

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ dryrun lint
141141

142142
All commands work offline from the schema file. Each project has its own `dryrun.toml` and `.dryrun/`, there is no global state. Add `.dryrun/` to your `.gitignore`.
143143

144-
Snapshots live in `~/.dryrun/history.db`, keyed by `(project_id, database_id)`. The MCP server reads from the history db first and falls back to `.dryrun/schema.json` for first-run or shared snapshots. After `dryrun snapshot take` it will switch to DB.
144+
Snapshots live in `.dryrun/history.db`, keyed by `(project_id, database_id)`. The MCP server reads from the history db first and falls back to `.dryrun/schema.json` for first-run or shared snapshots. After `dryrun snapshot take` it will switch to DB.
145+
146+
Static file `schema.json` will be deprecated in future.
145147

146148
### Multi-node: capture activity from replicas
147149

@@ -193,6 +195,35 @@ Every DB-related command (`init`, `import`, `probe`, `dump-schema`, `lint`, `dri
193195

194196
> **Note:** the MCP server is currently single-database. Using the default profile. Or the option is to run one `dryrun mcp-serve` process per database. Native multi-database support inside one MCP process is tracked in [#7](https://github.com/boringSQL/dryrun/issues/7).
195197
198+
### Sharing snapshots across a team
199+
200+
DryRun's value increases in team setup. Multiple developers can pull snapshots from any POSIX compliant directory.
201+
202+
To publish the snapshots you need
203+
204+
```sh
205+
cd project_name
206+
207+
# apture from the live DB (use cwd name for project name)
208+
dryrun init --db "$DATABASE_URL"
209+
dryrun snapshot take --db "$DATABASE_URL"
210+
dryrun snapshot push --to-path ./snapshots --all
211+
```
212+
213+
Developers can then import the snapshots to the local history
214+
215+
```sh
216+
dryrun snapshot pull --from-path ./shared/snapshots --all
217+
```
218+
219+
Snapshots are content-addressed (`{project}/{database}/{ts}-{hash}.json.zst`) and idempotent: pushing the same snapshot twice won't change it.
220+
221+
The simplest deployment is a dedicated git repo. Create the snapshots repo and add `*.json.zst binary` to `.gitattributes` so git stops trying to diff bundles.`
222+
223+
Offline tools (`lint`, `check_migration`, `drift`) work immediately after the pull.
224+
225+
No server, no credentials. Same promise as before.
226+
196227
## MCP server
197228

198229
Add `dryrun` to your AI assistant. If you installed via Homebrew, `dryrun` is already on your PATH:

0 commit comments

Comments
 (0)