How to work on dbt models in Omni that aren't yet written into production

Create a new dbt model and work on it in an Omni branch

Firstly, the model must be built within your development environment.

  • Run the dbt build command, using your development environment

Secondly, the code for the dbt model must be pushed to GitHub (or other git provider)

  1. Create a branch in your git repository (git checkout -b branch_for_my_new_model)

  2. Add the code for your dbt model to the branch (git add models/my_new_model.sql, git commit -m “add new model”

  3. Push the code to GitHub (git push -u origin branch_for_my_new_model)

Now, switch into Omni

  1. Create a branch in Omni that has the exact same name as your git branch (from the example above, branch_for_my_new_model). If the name is not the same, this will not pick up your git branch’s changes

  2. Switch to your dbt development environment in the branch header at the top

  3. Run a refresh schema from the menu Model → Refresh schema

  4. Viola! Your development models are now present for you to work with in Omni before you push them to production within your database