Skip to main content
While not every query needs to be pushed down to dbt, when you do create a query where you want to promote the logic into dbt, you can do so within Omni. Omni also supports editing existing models. You can run and compile dbt SQL with Jinja references and config settings, allowing you to interact with data as you build and eliminate the need for manual SQL substitutions when referencing existing models. Models authored in Omni can then be materialized through existing dbt workflows without requiring complex warehouse permissions for schema ownership.

Requirements

To follow the steps in this guide, you’ll need:

Creating new dbt models from Omni queries

  1. In a workbook, open the query you want to use to create the model.
  2. Click Model > Convert to dbt model.
  3. Omni will convert the query to dbt SQL. Use the SQL editor to build the model, periodically running the query to check that the data is as you expect.
  4. When finished, click Model > Push to dbt repo.
  5. In the Push to dbt dialog, modify the dbt file name, git branch, and commit message as needed, clicking Push when finished.
  6. You’ll be prompted to create a pull request in the dbt git repository. Complete the pull request process, following your organization’s process.
After the pull request is merged, the new model can be integrated with existing CI/CD pipelines, approval flows, or other git-based automations. You can bring the model into Omni by triggering a schema refresh after the model is built in your warehouse.

Editing dbt models

While the dbt IDE is read-only, you can edit existing dbt models in a workbook and push changes back to the dbt repository.
Modeler permissions are required to edit dbt models.
  1. Navigate to Develop, select your model, and click the dbt icon in the sidebar.
  2. Use the file picker to select the dbt model you want to edit.
  3. Click the Open in workbook button near the top right corner of the page:
  4. The model opens in a new workbook. Use the SQL editor to iterate on the model.
  5. When finished, click Model > Push to dbt repo and follow the same push flow as creating a new model.
After the model is rebuilt in your warehouse, bring in the updated version by triggering a schema refresh.