Connect a database
A source is a production database anybranch keeps a live replica of. Run preflight, then clone/sync. Both are branched the same way.
Two ways to make a root
sync/clone— a root that continuously replicates from a live database, using the engine’s own replication.import— a root from a stopped data directory, a SQLite file, or--new(an empty database).
Preflight first
Preflight is read-only. It prints a pass / warn / fail checklist and, when grants are the problem, a ready-to-run grant script. It creates nothing and stores no credentials. sync runs the same checks and refuses on any failure.
Replica identity
Logical replication needs a way to identify rows for UPDATE and DELETE. Tables without a PRIMARY KEY are skipped, and the exact ALTER TABLE … REPLICA IDENTITY FULL to include them is printed. Pass --fix-replica-identity to apply those on the source for you.
Engines
| Engine | Sync mechanism | Schema changes |
|---|---|---|
| Postgres | logical replication | event-trigger replay, or reconcile |
| MySQL | GTID replication | native (binlog) |
| MongoDB | dump + change streams | indexes, collections, collMod |
| SQLite | n/a (file import) | n/a |