zzob
zzob

Reputation: 1134

How to refresh view using DBT?

I couldn't find any docs about refresh view. Like i did using SQL on PostgreSQL REFRESH MARTERILZED VIEW

dbt run # create view/table
dbt refresh ?

There no option for refresh view that created by dbt right?

Upvotes: 0

Views: 646

Answers (1)

Farid
Farid

Reputation: 21

to refresh a materialized view you could add sql header like below on the any model that want to reference it:

    {{
        config(
          ...
              ,
          sql_header="REFRESH MATERIALIZED VIEW view_name;"
      
        )
    }}

Upvotes: 0

Related Questions