dbt model contracts: build-time guarantees on column shape before consumers break
Model contracts
dbt Labs docs on model contracts—upfront shape guarantees verified at build, plus governance caveats and support limits.
Based on
Model contracts | dbt Developer Hub
The page argues that a SQL select is easy to iterate, but changing result shape is risky when others query the model. A contract is an upfront guarantee of that shape; while building, dbt verifies the transformation matches or fails the build. Related ideas include contract columns and constraints. Governance features (access, contracts, versions) strengthen trust and stability but can make rollbacks harder and raise maintenance if added too soon—especially while models still churn. Contracts are model-specific: not for snapshots, seeds, or sources. Supported surfaces include dbt_project.yml, properties.yml, and SQL models materialized as table, view (names and types, not constraints), or incremental with certain on_schema_change settings. Unsupported cases include Python models, materialized view or ephemeral, custom materializations unless authors add support, and recursive CTEs in BigQuery (extract cuts off there). Platform support for enforced constraints varies.
Downstream data contracts stop being tribal knowledge: the warehouse build itself rejects drift before BI or services absorb a breaking column change.
Contracts encode shared meaning of a model’s interface—names, types, and constraints—so producers and consumers agree on structure under explicit governance.
Put this to work on CoreModels
Related connectors and recipes
See all connectors →Take the next step
Try CoreModels, talk with our team, or explore more resources.