World reference data from the catalog
Static regions plus catalog-backed continents, countries and subdivisions.
- Languages
deueng- Formats
csv
Recipe
gbddl 1
language eng
table regions (
code text
name text
) values (
("APAC", "Asia-Pacific"),
("EMEA", "Europe, Middle East and Africa"),
("AMER", "Americas")
)
table continents catalog(continent) (
code text primarykey catalogField(column: "code")
name text catalogField(column: "name")
)
table countries catalog(country, group: "G20") (
iso2 text primarykey countryCode()
name text country()
currency text currency()
)
table subdivisions language(deu) catalog(subdivision, parent: "BRA") (
code text primarykey subdivision(format: "short")
name text subdivision()
)
table sample_places rows 10 (
id int64 autoincrement primarykey
continent text same(cat) continent()
language text languageName()
)
output csv
This is the exact recipe.gbddl committed to the repository. Copy it, or download the raw source.
About this recipe
World reference data
A multi-table recipe that generates world reference data: a small static region table plus catalog-backed continents, countries and subdivisions.
What it demonstrates
- Static table —
regionsis avaluestable with three literal rows. - Catalog tables —
continents,countriesandsubdivisionseach read their records from the catalog withcatalogFieldor record smart types. - Table language —
subdivisionsdeclareslanguage(deu), so its names are localized to German. - Catalog coherence —
sample_placesgroupscontinent()undersame(cat), the catalog coherence family, and writeslanguageName()alongside it.
Run it
Submit the recipe body to POST /api/v1/jobs?input_format=gbddl, or paste it
into Chef, to generate the data. The repository's local runner (run by
task test) also generates it and verifies its output.
The recipe outputs CSV files: regions.csv, continents.csv, countries.csv,
subdivisions.csv and sample_places.csv.
Guarantees
Each catalog table's primary key is unique and every row is a real record of the selected catalog type. Values are reference data, not generated text.
Tested features
Smart types, physical types, rules and formats this recipe exercises and verifies.
table:statictable:catalogcatalogFieldcountryCodecountrycurrencysubdivisioncontinentlanguageNamelanguage:tablesame:catalogprimary-keyautoincrement