The projects that produced the real sqb output on the landing page, so it can be regenerated when
the CLI changes. Build output, logs and DuckDB files are not kept; every project runs locally on
DuckDB.
| Project | Landing page |
|---|---|
waffle-shop/ |
Steps 01 to 07. It is sqb playground waffle-shop plus the custom Rule in rules/layers.py and its test, the scoped enum and macros under models/marts/_sqlbuild/, and the renamed daily_order_rollup model. |
tidy-shop/ |
Step 08, the janitor. |
hero-shop/ |
The hero: a model moved and renamed. |
Step 01 shows the semantic compile checks for unknown columns and type mismatches. In a copy of
waffle-shop:
- In
sources/raw.yml, addcontract: enforcedtoraw__customersandraw__orders, so the columns and types that flow into the models are authoritative. - In
models/marts/fact_orders.sql, changeo.quantity,too.qty,and addWHERE o.ordered_at > 5as the last line. - Run
sqb compile.
tidy-shop shows the state after the stale model was removed. To regenerate the output, restore it
first:
cd tidy-shop
cat > models/weekly_revenue.sql <<'SQL'
MODEL (
description "Weekly revenue totals",
materialized table,
);
SELECT DATE_TRUNC('week', revenue_date) AS revenue_week, SUM(total_revenue_cents) AS total_revenue_cents
FROM __ref("daily_revenue")
GROUP BY 1
SQL
sqb build
rm models/weekly_revenue.sql
sqb janitorwaffle-shop shows the state after the rename. Give the model its old name, build it, then rename
it back:
cd waffle-shop
mv models/marts/daily_order_rollup.sql models/marts/daily_activity_rollup.sql
sed -i 's/daily_order_rollup/daily_activity_rollup/g' models/marts/hourly_activity_with_daily_context.sql
sqb build
sqb rename daily_activity_rollup daily_order_rollup
sqb planhero-shop shows the state after the move. The model started as models/marts/revenue.sql:
cd hero-shop
mkdir -p models/marts
mv models/finance/daily_revenue.sql models/marts/revenue.sql
sqb build
sqb mv revenue models/finance/daily_revenue.sql
sqb plansqb rename and sqb mv add migrate_from to the model header; the example projects leave it out,
so they can be set up again.