Commands
Global Flags
All commands support these global flags:Environment Variables
Workflow
The typical pgtofu workflow involves these steps:Output Formats
JSON Schema
Theextract command outputs a JSON file containing the complete database schema:
Migration Files
Thegenerate command creates golang-migrate compatible files:
migrations
000001_description.up.sql
000001_description.down.sql
000002_description.up.sql
000002_description.down.sql
Exit Codes
Docker Usage
When running via Docker, mount your working directory:Next Steps
extract
Learn how to extract database schemas
diff
Compare schemas and preview changes
generate
Generate migration files
partition
Generate hash partition statements