Self-hosted Postgres
Postgres 13+ with logical replication. anybranch reads the schema and streams changes; your application tables are never written to.
Requirements
wal_level = logical(needs a restart to change).- A free replication slot and WAL sender.
- A role with the
REPLICATIONattribute that can read the tables and owns them — a publication needs the table owner. - A PRIMARY KEY on each replicated table (or
--fix-replica-identityto setREPLICA IDENTITY FULL).
$ anybranch preflight postgres 'postgresql://user:pass@host:5432/app' --schemas publicPreflight prints a grant script when reads or ownership are missing. Run it on the source, then re-run preflight until it passes.
What anybranch creates on the source
All named anybranch_<name>: a publication, a replication slot, a schema holding a ddl log table, and an event trigger that records each DDL statement. The DDL table is itself replicated and replayed on the replica, so migrations on production appear on branches, and new keyed tables join replication automatically. The event trigger swallows its own errors, so it can never fail your DDL. rm removes everything it created.
status says schema changes are not tracked; run anybranch reconcile <name> after a migration to add the new columns and tables.Sync
$ anybranch clone prod 'postgresql://user:pass@host:5432/app'
$ anybranch status prod # initial-copy progress, WAL lag, schema trackingClient TLS
Pass TLS options in the connection string itself, e.g. ?sslmode=verify-full&sslrootcert=…&sslcert=…&sslkey=….