DB-Size Scoring

Risk levels automatically escalate when a migration targets a large table. pgfence never requires database credentials.

Stats Snapshot (Recommended)

Your CI runs a read-only stats step against a replica or trusted snapshot, writes pgfence-stats.json, and pgfence consumes it locally. pgfence never sees your database credentials.

bash
# Step 1: generate stats in CI (your script, your credentials)
# Step 2: analyze with the stats file
pgfence analyze --stats-file pgfence-stats.json migrations/*.sql

Direct Connection

bash
pgfence analyze --db-url postgres://readonly@replica:5432/mydb migrations/*.sql

Risk Escalation Table

Table SizeRisk Adjustment
< 10K rowsNo change
10K – 1M rows+1 level
1M – 10M rows+2 levels
> 10M rowsCRITICAL regardless