Updated
On this page
pgdesign is a PostgreSQL schema compiler: TOML schemas become SQL DDL, with normal-form auditing, content-addressed migrations, and code generation.
#pgdesign
A PostgreSQL schema compiler. You declare your database in TOML; pgdesign compiles it to SQL DDL and enforces database design principles on the way.
Columns are NOT NULL unless you opt out, foreign keys need an explicit on_delete, every table needs a comment, and normal-form violations are reported with counterexamples rather than left for production to find.
#Start here
- Quickstart -- install it, write a schema, generate DDL
- Format reference -- the full TOML syntax
- Semantic types -- built-in types, enums, domains, composites, and state machines
- Validation rules -- every error, warning, and info code
#Guides
- The migration chain -- revisions, edges, the journal, and the integrity guarantees
- Migration guide -- generating, applying, rolling back, squashing, and rebasing
- Cross-repository imports -- referencing another project's tables across a git pin
- Code generation -- type-safe application code in six languages
- Design intelligence -- cascade analysis, dead columns, natural keys, and row sizing
- Workload analysis -- index recommendations from schema shape and live statistics
- Diffing -- against a database, another TOML, or a git ref
- Architecture laws -- the invariants the kernel is built on
#Reference
- CLI reference -- every command and flag
- API reference -- every package