6. Export logic as a dbt model or database view

An optional, but very useful last step.

Once you've uncovered something useful in your exploration, it's best practice to do your best to make it easier to find similar things next time.

Often this takes the form of saving a view in your database or a model in dbt so you can find you way back to a helpful table quickly next time.

Export compiled SQL

In your DAG you can find the cell you want to save as a view or model. Right-click on that cell and click 'Copy Compiled SQL'.

Now you have full compiled SQL in your clipboard. From there you can:

  • paste into dbt and save as a model

  • paste into your SQL IDE and save as a scheduled query or a view

If you find yourself performing this step often, check out our dbt integration too.

Last updated