pgxgen
pgxgen configuration file
| Type | object |
|---|---|
| File match |
pgxgen.yml
pgxgen.yaml
|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/pgxgen/latest.json |
| Source | https://raw.githubusercontent.com/tkcrm/pgxgen/refs/heads/master/schemas/pgxgen-schema.json |
Validate with Lintel
npx @lintel/lintel check
Configuration file for pgxgen code generator
Properties
Config version (must be '2')
Array of schema configurations, each with its own engine and tables
User-provided template directories
2 nested properties
Directory with custom CRUD SQL templates
Directory with custom Go model templates
Definitions
Human-readable schema name
Database engine
Path to SQL migration/schema files
12 nested properties
Full Go import path for the models package
Custom types defined in the models package
Table/view names to exclude from model generation
Enum names to exclude from model generation
Add // @name StructName comments to generated structs (useful for Swagger)
2 nested properties
Default sqlc gen.go options applied to all repos
14 nested properties
3 nested properties
8 nested properties
Per-table repos: queries_dir = {prefix}/{table_name} (not affected by package_prefix/package_suffix)
Per-table repos: output_dir = {prefix}/{package_prefix}{table_name}{package_suffix}
Per-table repos: prefix for the output directory/package name (does not affect queries_dir_prefix), e.g. repo_
Per-table repos: suffix for the output directory/package name (does not affect queries_dir_prefix), e.g. _repo
Single repo: all queries in one directory
Single repo: all output in one directory
3 nested properties
1 nested properties
Per-table configuration (crud + constants + sqlc)
Full Go import path for the models package
Custom types defined in the models package
Table/view names to exclude from model generation
Enum names to exclude from model generation
Add // @name StructName comments to generated structs (useful for Swagger)
Default sqlc gen.go options applied to all repos
14 nested properties
3 nested properties
Per-table repos: queries_dir = {prefix}/{table_name} (not affected by package_prefix/package_suffix)
Per-table repos: output_dir = {prefix}/{package_prefix}{table_name}{package_suffix}
Per-table repos: prefix for the output directory/package name (does not affect queries_dir_prefix), e.g. repo_
Per-table repos: suffix for the output directory/package name (does not affect queries_dir_prefix), e.g. _repo
Single repo: all queries in one directory
Single repo: all output in one directory
3 nested properties
1 nested properties
Override queries directory
Override output directory
1 nested properties
1 nested properties
1 nested properties
1 nested properties
Override method name
RETURNING clause (PostgreSQL)
2 nested properties
Output to this table's queries_dir