chrish
08/12/2022, 10:37 PMvs_ny_main where 'ny' is the abbreviation for New York.
I would really rather not configure loaders: in my meltano.yml for each state as they will be slowly added over time, and some servers may have some states and other servers may have different ones.
Is there any way to configure the target-postgres plugin to dynamically support multiple databases?
Or, is there a way to cause meltano to get list of matching databases on the server and then for each database run the pipeline?aaronsteers
08/12/2022, 10:45 PMaaronsteers
08/12/2022, 10:45 PMchrish
08/12/2022, 10:47 PMchrish
08/13/2022, 1:38 PMfiles which are really file paths in tap-csv.
Can I create a list of databases with target-postgres?
Hacking around, I haven't figured it out yet - but I'm going to crack open the code and look deeper.chrish
08/13/2022, 1:45 PMmeltano run command 4 times, one for each environment.
Am I understanding the current capabilities correctly?chrish
08/13/2022, 2:08 PMloaders:
- name: target-postgres
config:
user: centurion
dbname: vs_id_main
default_target_schema: public
primary_key_required: false
- name: target-postgres
config:
user: centurion
dbname: vs_oh_main
default_target_schema: public
primary_key_required: falsedouwe_maan
08/15/2022, 1:19 PMmeltano.yml feature to use than environmentsdouwe_maan
08/15/2022, 1:20 PMmeltano run with the same target-postgres but different settings by injecting the proper values using environment variables: https://docs.meltano.com/guide/configuration#configuring-settings. You could have a script that loops over the target databases, and runs meltano run for each with the appropriate env.chrish
08/17/2022, 12:06 AMloaders:
- name: target-postgres-id
inherit_from: target-postgres
config:
user: postgres
dbname: id
default_target_schema: public
primary_key_required: false
- name: target-postgres-oh
config:
dbname: ohchrish
08/17/2022, 12:12 AMmeltano run, but I'm trying to avoid having scripts to run things where I can - fewer layers to maintain. Though I may end up scripting it out if I end up with a number of different postgres servers with different sets of databases.
Right now, with the inheritance feature, I can get down to having just two different commands I run, one for dev and one for prod, and I want those two split anyway. So I'm happy!