Skip to content

Conversation

kayrus
Copy link

@kayrus kayrus commented Aug 17, 2016

If shell script downloads some sql dumps, these dump are not being processed. This PR runs shell scripts first, then process the dump.

@yosifkit
Copy link
Member

If you already have a script, why not just have it import the sql without even saving it to a file?

curl -fSL somefile.sql | "${psql[@]}"
@kayrus
Copy link
Author

kayrus commented Aug 17, 2016

@yosifkit curl can do that, but not rsync or scp...

@yosifkit
Copy link
Member

Curl can do sftp connections too: http://unix.stackexchange.com/a/147047. You could also just dump your new sql files into any folder and then import them all with your script and even delete them once done if you need to.

What I am really trying to say is that this would introduce a backwards incompatible change. Some users are probably relying on interspersing their scripts and sql files by naming them correctly.

# possible fake example $ ls /docker-entrypoint-initdb.d/ 2016-01-01-sql-setup-script.sh 2016-01-02-seed-data.sql 2016-02-01-migration-script.sh 2016-02-02-extra-data.sql
@kayrus
Copy link
Author

kayrus commented Aug 18, 2016

Last example makes sense. Thanks for your time.

@kayrus kayrus closed this Aug 18, 2016
@kayrus kayrus deleted the kayrus/run_sehll_first branch August 18, 2016 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants