🥪 Advent of dbt CalendarStart here

Day 1 of 12 · Tue Dec 1 · dbt build, static analysis

The Note in the Toastie Iron

The story

It's the first week of December, 6am, and the Jaffle Shop in Philadelphia is cold and dark. Jairko, who runs the data side of the shop, has come in early to fix the oldest toastie iron on the wall. It's been there since the day the shop opened, and it won't heat.

Wedged behind the hinge he finds a note from the shop's founder, the Old Toastmaster, whom nobody has seen in twenty years:

The Golden Jaffle is not in a cookbook. It lives in the data. I tore the recipe card in two and gave each half to an apprentice. Build the project, follow the crumbs, and it will toast.

The note ends with the name of a dbt project that nobody ever built. It's on the shop's old laptop, next to six months of the Philly store's orders from last season, and its dbt_project.yml has a toast stain on it. Jairko's hands are covered in butter, so you take the keyboard.

How Advent of dbt works

Each day has two parts, and each part ends with a crumb: a number or a short word you find by running dbt. Type it into the answer box to check it. A new day opens every weekday at 8am CET. The Start here page has the rest: what you need, how to catch up, and how to reset.

A quick tour of the project

Skip this if you already use dbt.

Get today's starter

git clone https://github.com/dbt-labs/advent-of-dbt advent-of-dbt
cd advent-of-dbt
git checkout -f day-01-start

No git? Download day-01-start.zip. You need dbt 2.0.13 or later (dbt --version).

Open the advent-of-dbt folder in an editor such as VS Code, with its terminal at the bottom, and run every command there: you'll see the files dbt creates or rewrites as it happens. Install the official dbt extension too (publisher dbt Labs LLC), for VS Code, Cursor or Windsurf.

Part 1: The first toast

Before Jairko trusts anything the Old Toastmaster left behind, he wants to see the project work once. Install its packages, then build the whole thing with dbt build:

dbt deps
dbt build

Everything should come out green: the seeds load, the models build and the tests pass. The Toastmaster's note says to count the orders before you trust anything else, so:

How many rows does the orders model have?

Hint

dbt show --inline "<your SQL>" runs a query against your project and prints the result. In the SQL, write {{ ref('orders') }} wherever you'd write a table name.

Crumb 1: a number.

Part 2 appears once you have found crumb 1.