dbt constraints validate table data only when contracts are enforced
constraints | dbt Developer Hub
Reference on platform constraints in dbt: validation on write, contract prerequisite, and uneven enforcement across warehouses.
Based on
constraints | dbt Developer Hub
The extract defines constraints as platform checks during table population or insert. On failure, creation or update fails, rolls back, and surfaces an error; when enforced, invalid data should not appear in the materialized table. It stresses that enforcement differs significantly by platform.
For engineering teams, prerequisites are strict: supported materializations are table and incremental only; views and ephemeral models never get constraints; and a contract must be declared and enforced with data_type on every column. Constraints are grouped as definable-and-enforced, definable-but-not-enforced (metadata), or not definable on that platform.
Governed shared meaning here is the guaranteed shape and validity of physical tables that other systems read. Contracts supply the declared schema; constraints are the platform’s attempt to keep stored data aligned with that declaration—within the limits each warehouse actually enforces.
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.