⚙️dbt Source
Also known as dbt Sources, dbt source()
A raw table listed in dbt, so models can read it by name.
Think of it like
It is like labels on jars in a kitchen. Each recipe names the jar by its label.
Example
The raw orders table moves to a new schema. Lucy changes one line in the sources file, and all 30 models that read it still work.
Why it matters
Raw table names live in one place. The lineage graph also shows which models depend on which raw data.
Definition
Example code
yaml
sources:
- name: shop
tables:
- name: orders
- name: customersCommon mistake
Key takeaways
- 1Raw, not built. Sources are tables dbt did not make.
- 2Listed once. Names live in one YAML file.
- 3Start of lineage. The graph begins at the sources.