Skip to content

Product identifiers, units and prices

A product catalog with structured identifiers, units of measure, prices and categories.

simple volume small ProductsPricing
Languages
eng
Formats
csv

Recipe

recipe.gbddl
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 — sku is a pattern mask (PRD-####) and gtin is a GS1 number with a valid check digit; both are unique.
  • Units — unit writes UN/ECE Recommendation 20 codes and unit_erp writes the short codes ERP systems use.
  • Pricing — price is a decimal amount.
  • Categories — category picks from a fixed enum list, and active is a boolean biased toward true.

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 enum values to your own product categories.
  • Widen sku's #### mask for a larger catalog.
  • Raise rows to 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