Open LauLaman opened 7 years ago
I really like this idea. I think we just have to figure out the syntax a bit.
@LauLaman That might already be possible with some more advanced use of the Go text template processor.
You would define the range of values in your playbook:
:variables:
:countries: ["it", "nl"]
and then the .sql
file can 'loop' through them:
{{ range .countries }}
CREATE TABLE raw_data_{{ . }}.new_table AS (
SELECT col1, col2, col3
FROM table
);
{{ end }}
At @Werkspot we are active in multiple countries. Each country has exactly the same database structure. We load each country in a separate schema in Redshift
I would like to create a playbook where i can run steps in a loop with different variables.
I was thinking about something like this: (i know i can put multiple Queries in one file but want to make clear what i was thinking about)