I am using dbt for some ELT work. I was wondering if it is possible to, after using dbt compile to generate the SQL queries, to find out in which order they should be run. Is this information available somewhere?
So currently I use the manifest.json to build the list of queries based on the depends_on. This gives me a list of paths to each sql query. Now my question is, if I take that list, and run each query, would that give me the same output as dbt run? My goal is to use dbt to compile the queries and then run them separately.
@joellabes Sure, sorry. I would like to generate all the compiled queries that dbt runs, without running them. This would include the materialisations, which to my understanding are not included in the compiled queries when running dbt compile. I would like to be able to run those queries as they are, outside dbt, and obtain the same outcome as if I ran dbt run. Is this feasible? Would I just need to edit the compiled queries inserting the SQL code as per the materialisation type of the model (i.e., create table / create view)?
This is the part I don’t understand - why is this a goal for you?
dbt’s capabilities as a string templater are nice, but normally people come to it for the rest of the experience (including executing nodes in the right order and not having to worry about whether nodes already exist etc for creating/dropping/modifying columns in existing tables).
This is correct - dbt compile will not wrap the queries in the appropriate DDL.