Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I load or run multiple SQL files in Datagrip?

I have set up a project in DataGrip with several sql files spread over a couple of directories like this: Project File Structure

My hope is to manage the complexity as this turns into hundreds of files. This is a learning/proof of concept level effort right now.

What I want to do is have a way to run/build/publish this project but at present the best I have found is to select the files and then do a "Run Files" CTRL+SHIFT+F10. This worked for a bit but now I have a foreign key that gets run in the wrong order. I don't want to have to make a hack like prefixing the file names with integers to force a specific order. It feels like a real kludge.

How should I accomplish this, I must have missed something since the alternative is very manual and error prone. If it matters the database I am working against is Oracle.

like image 978
Ukko Avatar asked Apr 12 '17 20:04

Ukko


1 Answers

Since DataGrip 2020.1 one can create a Run Configuration and specify data source and multiple files or scripts:

run configuration set up

Refer to DataGrip blog post.

like image 128
Vasilii Chernov Avatar answered Oct 31 '22 16:10

Vasilii Chernov