dbt-core
No Change
trial
dbt-core. Is the open-source CLI that transforms data in the warehouse: versioned SQL models, tests, docs, and a DAG executed with dbt build.
Summary
Garden stance: We trial dbt-core for our estate.
When to use: Evaluate on a project when the capability clearly fits the requirement.
When to skip: When a simpler alternative already covers the need.
Details
Project layout
The project is the unit of work. It must include dbt_project.yml (model paths, profiles, vars). Main artifact types:
| Artifact | Purpose |
|---|---|
| Models | Transforms; nodes in the execution DAG |
| Snapshots | SCD-style history for mutable sources |
| Seeds | CSV loads into the warehouse |
| Tests | Data quality on models and sources |
| Macros | Reusable Jinja/SQL |
| Sources | Upstream tables loaded by other tools |
| Exposures | Downstream consumers of the project |
| Analyses | Ad hoc SQL (not materialized on run) |
(Semantic models, metrics, and saved queries apply when using the metrics layer; see current dbt docs for your version.)
CLI reference (common)
build: run DAG in order (models, tests, seeds, snapshots as configured)run: execute models onlytest: run tests (usually afterrun)compile: render SQL without executingdeps: install package dependenciesdebug: connection and profile diagnosticsfreshness: source freshness checkssnapshot/seed: run those node types
Incremental models on existing tables
When a table is owned elsewhere but dbt should merge new rows:
- Model name matches the table (case-sensitive per adapter)
materialized='incremental'unique_keyset for merge/upsertincremental_strategy(appendormergeper adapter)- Use
is_incremental()and{{ this }}for watermark logic
| |
See Incremental models.
References