- Constraints let Omni automatically pick up primary keys, relationships, and column descriptions from dbt.
- dbt clone creates zero-copy clones of production objects in your dev schema, so Omni can resolve all table references without you having to rebuild everything.
Common questions
Does dbt clone override local changes?
Does dbt clone override local changes?
No. Cloning creates zero-copy clones of all production objects in your development schema. If you then run
dbt build or dbt run on a specific model, dbt replaces that clone with the table or view built from your code. Omni picks up the new version automatically.Can dbt constraints be used with views?
Can dbt constraints be used with views?
In many warehouses, constraints are applied to tables rather than views. If your dbt project outputs views, define constraints at the model level in dbt so Omni can still inherit that logic, even if the warehouse doesn’t enforce them on the view.
Requirements
- A configured dbt integration
- For constraints - Constraints defined in your dbt project (using
dbt-constraintsor native dbt constraints) - For deferrals - A production environment configured in Omni with successful builds
dbt constraints
Omni automatically inherits the semantic logic you’ve defined in your dbt project to build a baseline model.- Relationship inheritance: If you have primary keys and relationships defined in your dbt project, Omni can automatically create the corresponding relationships and primary keys in your Omni model. To enable this, turn on Auto-generate primary keys and relationships from dbt constraints in your dbt connection settings.
- Description sync: Column descriptions defined in your
schema.ymlfiles are brought into Omni automatically, providing immediate context in the UI. - Automated joins: Omni maps join paths based on your dbt constraints. When a user combines fields from
OrdersandCustomers, Omni joins them using the dbt-defined relationship.
dbt deferrals
Omni natively supports dbt deferrals through the Enable deferral checkbox in dbt environment settings. When enabled for development environments, Omni automatically resolves unbuilt models to the production build, eliminating the need for full dbt runs or manual dbt clone workflows when working with partial builds.Enabling deferral in Omni
The Enable deferral checkbox appears when configuring non-production dbt environments in Omni:- Navigate to your connection’s dbt tab.
- In the Environments section, add or edit a development environment.
- Check the Enable deferral box to automatically fall back to production builds for models not built in this dev environment.
Using dbt clone for zero-copy clones
While the Enable deferral checkbox handles most use cases,dbt clone remains a complementary option for creating zero-copy clones of production objects directly in your warehouse. This can be useful when you want physical copies of production tables in your dev schema:
- dbt Cloud
- Local dbt installation
Deferrals require at least one successful job run in the designated production environment.
- In dbt Cloud, enable the Defer to staging/production option in your development environment settings. This designates your production job as the reference point.
- Once enabled, run
dbt clonefrom the dbt Cloud IDE.
Troubleshooting
Table not found error after switching to dev environment
Table not found error after switching to dev environment
Omni expects every model referenced in an environment to physically exist in the target schema. If you’ve only built modified models, Omni can’t resolve the missing tables.Enable deferral for your dev environment to automatically fall back to production builds for unbuilt models. Alternatively, run
dbt clone before switching environments in Omni to create zero-copy clones of all production tables. If errors persist, confirm your database user has permission to read the production schema — see dbt connection setup for more information.Next steps
- Connecting dbt to Omni — Configure the dbt integration if you haven’t already.
- Working with dbt models — Author and edit dbt models from Omni.
- Connection environments — Set up dynamic environments for safe testing.