Keep handy
Command reference
The commands and naming rules you will actually use, searchable and copy-paste ready.
Everyday dbt
dbt build -s my_modelRun the model and its testsdbt build -s +my_modelBuild everything upstream first, then the modeldbt build -s my_model+Build the model, then everything downstreamdbt run -s my_modelRun the model only (no tests)dbt test -s my_modelRun the model's tests onlydbt show -s my_modelPreview the first 5 rowsdbt show -s my_model --limit 20Preview more rowsdbt compileCompile the whole project — seconds on Fusion; catches broken refs and Jinja errors everywheredbt seedLoad CSV files from seeds/ into Snowflake as tablesdbt snapshotRun snapshots explicitly (dbt build runs them only when selected)
Setup & health
dbt depsInstall package dependencies (after every pull that changes packages.yml)dbt debugCheck connection and configuration.\start_dbt.ps1Project setup script — Fusion install, hooks, env
Project helpers
.\build_changed.ps1Build only models changed on your branch.\build_changed.ps1 -d…including downstream modelspython scripts/sources/run_all_source_generation.pyRegenerate source YAML + raw modelsdbt run-operation generate_model_yaml --args '{"model_names": ["my_model"], "upstream_descriptions": true}'Scaffold YAML for a built model
Docs
dbt docs generateBuild the documentation sitedbt docs serveOpen the docs site locally (lineage, search)
Git
git switch -c feat/my-changeCreate and switch to a new branchgit statusWhat changed? Run before every commitgit add path/to/fileStage a file for commitgit commit -m "feat: description"Commit staged files (conventional format)git pushPush your branch to GitHubgit switch main && git pullBack to main and update after a mergegh pr create --fillOpen a pull request from the terminal
Naming cheat sheet
Need the reasoning rather than the lookup? The model taxonomy lesson covers reading names, model families and search-before-build.
| Prefix | Layer | Means |
|---|---|---|
raw_ | Raw | Auto-generated 1:1 source view — never edit |
stg_ | Staging | Cleaned single-source model, no joins |
int_ | Modelling | Intermediate building block |
dim_ / fct_ | Reporting | Dimension / fact, analyst-facing |
pit_ / obt_ / dq_ | Reporting | Point-in-time / one-big-table / data-quality |
sem_ | Semantic | Snowflake semantic view (semantic layer) |
Programmes may add their own reporting prefixes (cltcs_, def_) — the layer rules above still apply.
Suffixes: what one row means
| Suffix | One row per | Example |
|---|---|---|
_all | Event — every record ever, many per person | int_hba1c_all |
_latest | Person — most recent record only | int_hba1c_latest |
_current / _historical | Active now / full history | dim_person_current_practice |
_summary | Group — an aggregated rollup | dim_person_status_summary |
Name families worth searching
| Pattern | Finds |
|---|---|
dim_person_ | Every person-level attribute block: age, ethnicity, care home, language… |
fct_person_{condition}_register | Every disease register — 40+ conditions |
int_{drug class}_medications_all | Medication order events per BNF-style class |
stg_{source}_{table} | The cleaned version of any source table; mirrors raw_{source}_{table} |
Branch & commit conventions
| Thing | Format | Example |
|---|---|---|
| Branch | type/short-description | feat/opening-hours-staging |
| Commit | type: imperative description | feat: add opening hours staging model |
| Types | feat fix docs refactor test chore | |