Skip to content

Inventory balances by product and warehouse

Products, warehouses and their on-hand balances, written as an Excel workbook.

related volume small InventoryProductsLocationsRelationships
Languages
eng
Formats
xlsx

Recipe

recipe.gbddl
gbddl 1
language eng

table products rows 10 (
  id   int64 autoincrement primarykey
  name text words(maxWords: 3)
  sku  text unique pattern(pattern: "SKU-#####")
)

table warehouses rows 4 (
  id   int64 autoincrement primarykey
  name text words(maxWords: 2)
  city text same(geo) city()
)

table inventory_balances rows 24 per(products, 1, 3) (
  id           int64 autoincrement primarykey
  product_id   int64 fk(products.id)
  warehouse_id int64 fk(warehouses.id)
  quantity     int64 integer(min: 0, max: 500)
)

output xlsx

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

About this recipe

Inventory balances

A multi-table recipe that generates inventory balances: products, warehouses and their on-hand quantities.

What it demonstrates

  • Relationships — inventory_balances references products and warehouses.
  • Row distribution — per(products, 1, 3) gives each product one to three balance rows.
  • Excel output — all tables are written into one .xlsx workbook, one sheet per table.

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 Excel workbook with a sheet per table (products, warehouses, inventory_balances).

Guarantees

Every primary key is unique and every foreign key names an existing parent row. Values are synthetic.

Tested features

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

wordspatterncityintegeruniquefkpersame:geographyautoincrementprimary-key