7

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.

Ukko
  • 2,236
  • 2
  • 21
  • 33
  • Hello! What actually you want to have? Some model where you can clarify the order of files to run? – moscas Apr 13 '17 at 06:06
  • 1
    @moscas Something like that, back under Visual Studio we had a similar layout and had a master SQL file that listed the other files and the order to load them. At the end of the day I want be be able to say, load all of these files as a set and control the order so that constraints are honored. – Ukko Apr 13 '17 at 13:55
  • Sounds reasonable. Please, share your additional ideas in the created issue: https://youtrack.jetbrains.com/issue/DBE-4473 – moscas Apr 14 '17 at 11:32

1 Answers1

7

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.

Vasilii Chernov
  • 1,169
  • 8
  • 17