Skip to content

Warehouse locations and codes

Warehouses with codes, names, a coherent location and a capacity.

simple volume small LocationsInventory
Languages
eng
Formats
csv

Recipe

recipe.gbddl
gbddl 1
language eng

table warehouses rows 10 (
  id       int64 autoincrement primarykey
  code     text unique pattern(pattern: "WH-###")
  name     text words(maxWords: 2)
  city     text same(geo) city()
  country  text same(geo) country()
  capacity int64 integer(min: 1000, max: 1000000)
  active   boolean boolean(trueRate: 95%)
)

output csv

This is the exact recipe.gbddl committed to the repository. Copy it, or download the raw source.

About this recipe

Warehouses

A single-table recipe that generates warehouses: codes, names, a coherent location and a capacity.

What it demonstrates

  • Identity — code is a unique pattern mask and name drawn words.
  • Location — city and country share a same(geo) group, so they describe one place.
  • Capacity — capacity is an integer range and active a boolean.

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, warehouses.csv, holding ten rows.

Adapt it

  • Add a country_code column to the same(geo) group.
  • Raise rows for a larger network of warehouses.

Guarantees

Every row has a unique id and code; the location fields are coherent per row. Values are synthetic.

Tested features

Smart types, physical types, rules and formats this recipe exercises and verifies.

patternwordscitycountryintegerbooleanuniquesame:geographyautoincrementprimary-key