pgroll
$ pgroll Official Med RiskDeveloped by Xata, pgroll implements lock-safe, zero-downtime PostgreSQL migrations using dual-version schema views and background backfills. Agents can pgroll validate JSON/YAML migration files, inspect pgroll status, pgroll pull --json, and safely abort active rollouts with pgroll rollback.
brew install xataio/pgroll/pgroll pgroll executes multi-step expand/contract DDL and pgroll validate checks directly on local migration JSON/YAML files.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Uses structured JSON/YAML migration specs, pgroll validate, and pgroll pull --json, though pgroll status prints text rather than JSON.
- Native JSON migration specs and
pgroll pull --json pgroll validateruns pre-flight syntax checks
Separating pgroll start (expand) from pgroll complete (contract) enables instant pgroll rollback without downtime or data loss.
- Expand/contract lifecycle with instant
pgroll rollbackprior tocomplete
Single Go binary distributed via Homebrew tap, go install, and GitHub releases across macOS, Linux, and Windows.
- Static Go binary with
brew install xataio/pgroll/pgroll
Automates complex multi-step expand/contract triggers, backfills, and dual-schema views that are error-prone to hand-code in raw SQL.
- Automates zero-downtime dual-version schema views
Actively developed by Xata (xataio/pgroll) under Apache-2.0 license.
- Official
xataio/pgrollrepository under Apache-2.0
Good official docs and migration examples at pgroll.com/docs/, though operation schemas evolve rapidly across versions.
- Operation reference and tutorials at pgroll.com/docs
Security, Auth & Guardrails
Reads --postgres-url or PGROLL_PG_URL (plus standard libpq PG* env vars); does not persist credentials separately.
Apache-2.0 open-source CLI; free to use on any PostgreSQL instance.
# pgroll Agent Rules - Run `pgroll validate` and `pgroll status` before starting any migration. - Treat `pgroll start` as reversible via `pgroll rollback`, but require explicit approval before `pgroll complete` drops legacy columns.
Agent-Ready Command Recipes
Safe Read-Only Queries
pgroll validate migrations/
Checks JSON/YAML migration syntax and structural validity without applying changes.
pgroll status --postgres-url "$PGROLL_PG_URL"
Reports active or latest completed schema version and migration state.
Controlled Writes & Previews
pgroll start migrations/01_add_col.yaml --postgres-url "$PGROLL_PG_URL"
Creates the new schema view alongside the existing version so old and new app builds stay compatible until pgroll complete.
Strengths for Agents
- + Built-in
pgroll rollbackcleanly aborts active expand migrations with zero downtime. - + Dual-version schema views let old and new application code run concurrently.
- + JSON/YAML declarative migration specs and
pgroll validateintegrate neatly into CI.
Caveats & Pitfalls
- ! PostgreSQL-only; requires
pgroll initstate tables and settingsearch_pathin client connections. - !
pgroll statusoutputs human-readable text rather than--json.