Handbook contents

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 tests
  • dbt build -s +my_modelBuild everything upstream first, then the model
  • dbt build -s my_model+Build the model, then everything downstream
  • dbt run -s my_modelRun the model only (no tests)
  • dbt test -s my_modelRun the model's tests only
  • dbt show -s my_modelPreview the first 5 rows
  • dbt show -s my_model --limit 20Preview more rows
  • dbt compileCompile the whole project — seconds on Fusion; catches broken refs and Jinja errors everywhere
  • dbt seedLoad CSV files from seeds/ into Snowflake as tables
  • dbt 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 models
  • python scripts/sources/run_all_source_generation.pyRegenerate source YAML + raw models
  • dbt 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 site
  • dbt docs serveOpen the docs site locally (lineage, search)

Git

  • git switch -c feat/my-changeCreate and switch to a new branch
  • git statusWhat changed? Run before every commit
  • git add path/to/fileStage a file for commit
  • git commit -m "feat: description"Commit staged files (conventional format)
  • git pushPush your branch to GitHub
  • git switch main && git pullBack to main and update after a merge
  • gh 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.

PrefixLayerMeans
raw_RawAuto-generated 1:1 source view — never edit
stg_StagingCleaned single-source model, no joins
int_ModellingIntermediate building block
dim_ / fct_ReportingDimension / fact, analyst-facing
pit_ / obt_ / dq_ReportingPoint-in-time / one-big-table / data-quality
sem_SemanticSnowflake semantic view (semantic layer)

Programmes may add their own reporting prefixes (cltcs_, def_) — the layer rules above still apply.

Suffixes: what one row means

SuffixOne row perExample
_allEvent — every record ever, many per personint_hba1c_all
_latestPerson — most recent record onlyint_hba1c_latest
_current / _historicalActive now / full historydim_person_current_practice
_summaryGroup — an aggregated rollupdim_person_status_summary

Name families worth searching

PatternFinds
dim_person_Every person-level attribute block: age, ethnicity, care home, language…
fct_person_{condition}_registerEvery disease register — 40+ conditions
int_{drug class}_medications_allMedication order events per BNF-style class
stg_{source}_{table}The cleaned version of any source table; mirrors raw_{source}_{table}

Branch & commit conventions

ThingFormatExample
Branchtype/short-descriptionfeat/opening-hours-staging
Committype: imperative descriptionfeat: add opening hours staging model
Typesfeat fix docs refactor test chore