Updated
On this page
Reference for the pgdesign codegen command — usage, flags, arguments, and examples for the codegen subcommand of the pgdesign CLI.
#pgdesign codegen
Generate type-safe application code from schema definitions
Effect: mutating
#Flags
| Name | Short | Type | Default | Env | Description |
|---|---|---|---|---|---|
--lang | str | Target programming language for the generated code | |||
--mode | str | validators | Code generation mode determining what code to produce | ||
--output | str | Write output to a file at this path instead of stdout | |||
--split-mode | str | How to split multi-file Python DDL output: 'faceted' writes one file per object kind, 'self-contained' emits a single importable module | |||
--groups | list[str] | Restrict generation to tables in these schema groups (matches build's per-output group filtering) | |||
--source | list[str] | Restrict generation to tables from these source file basenames (matches build's per-output source filtering) | |||
--check | bool | Verify generated code on disk is up to date without writing anything; requires --output, exits 1 on any missing, stale, or orphan file |
#Arguments
| Name | Required | Description |
|---|---|---|
path | yes | Path to TOML schema file(s) or directory containing them |