Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dbt command to select only incremental models schema change

Tags:

dbt

I want to write a dbt command that will select only incremental models that have had a schema change (ie a new column has been added to the source data). The idea is then that I could add that statement as a regular deployment job to do a full refresh on those models. I think some combination of using the state:modified option and other selectors would work, but I haven't had much luck. Does anyone have any suggestions?

select only incremental models that have had a schema change since the last run

like image 779
Sam Clark Avatar asked Oct 24 '25 14:10

Sam Clark


1 Answers

The closest you will get is

state:modified.body,config.materialized:incremental

But you will get all SQL changes, not just schema changes.

like image 180
Josh D. Avatar answered Oct 27 '25 02:10

Josh D.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!