Support for 'source' in mysql
I have a repo in repo in phpstorm that contains various sql files for create views, SPs etc.
I want to create a file like install.sql tthat contains:
source file1.sql
source file2.sql
So that I can then run that one file and all my views etc are updated. The order that this files run is important.
I know this is possible from the cli and also that some gui clients support this - I believe that mysql workbench does for example.
Is there a way to do this in PHPStorm? If not can this go in as a feature request?
Please sign in to leave a comment.
Are you referring to the sql files concatenated into a single file you want to run as an import? Please provide more details about your scenario and the execution flow control
Essentially yes.
The idea is I would have a project like
and then a file called install.sql that would contain
source views/view1.sql
source views/view2.sql
source views/view3.sql
source Storedprocedures/storedprocedure1.sql
source Storedprocedures/storedprocedure2.sql
Running install.sql would then run on of those files in order
This can be done on the command line like:
mysql> source \home\user\Desktop\test.sql;
but being able to do it via the IDE and have the file in version control would be super useful
https://www.jetbrains.com/help/datagrip/run-debug-configurations-dialog.html
Once a job is created, it'll execute the scripts against the target you specified in a single go.