Documentation
pgmold is a PostgreSQL schema-as-code tool. Define schemas in native SQL, diff against live databases, and apply migrations safely.
# See what would changepgmold plan -s sql:schema.sql -d postgres://localhost/mydb
# Apply the migrationpgmold apply -s sql:schema.sql -d postgres://localhost/mydbGet started
Section titled “Get started” Installation Install pgmold via Cargo
Quick Start Up and running in 60 seconds
Guides
Section titled “Guides” Multi-File Schemas Organize schema across directories
Filtering Include/exclude by name or type
Adopting pgmold Baseline an existing database
CI/CD Integration GitHub Action and drift detection
Drizzle ORM Use Drizzle schemas as source
Safety Rules Destructive operation guardrails
Reference
Section titled “Reference” CLI Commands All commands and flags
Terraform Provider Schema management in HCL
GitHub Action drift-check action reference