Product identifiers, units and prices
A product catalog with structured identifiers, units of measure, prices and categories.
- Languages
eng- Formats
csv
Recipe
gbddl 1
language eng
table products rows 20 (
id int64 autoincrement primarykey
sku text unique pattern(pattern: "PRD-####")
gtin varchar(13) unique gtin()
name text words(maxWords: 4)
unit text unitOfMeasure()
unit_erp text unitOfMeasure(style: "erp")
price decimal(10, 2) decimal(min: 0.01, max: 5000)
category text enum(values: ["electronics","apparel","food","office","tools"])
active boolean boolean(trueRate: 80%)
)
output csv
This is the exact recipe.gbddl committed to the repository. Copy it, or download the raw source.
About this recipe
Products
A single-table recipe that generates a product catalog: identifiers, units of measure, prices and categories for twenty synthetic products.
What it demonstrates
- Structured identifiers —
skuis apatternmask (PRD-####) andgtinis a GS1 number with a valid check digit; both areunique. - Units —
unitwrites UN/ECE Recommendation 20 codes andunit_erpwrites the short codes ERP systems use. - Pricing —
priceis a decimal amount. - Categories —
categorypicks from a fixedenumlist, andactiveis abooleanbiased towardtrue.
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 one CSV table file, products.csv, holding twenty rows.
Adapt it
- Change the
enumvalues to your own product categories. - Widen
sku's####mask for a larger catalog. - Raise
rowsto produce more products.
Guarantees
Every row has a unique id, sku and gtin; prices stay inside the declared
range. Identifiers are synthetic and do not name real products.
Tested features
Smart types, physical types, rules and formats this recipe exercises and verifies.
patterngtinunitOfMeasurewordsdecimalenumbooleanuniqueautoincrementprimary-key