如何在Datagrip中加载或运行多个SQL文件? [英] How can I load or run multiple SQL files in Datagrip?

查看:728
本文介绍了如何在Datagrip中加载或运行多个SQL文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在DataGrip中建立了一个项目,其中多个SQL文件分布在几个目录中,如下所示:

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

我希望能够管理这种复杂性,因为它将变成数百个文件.目前,这是对概念级别工作的学习/证明.

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.

我想要做的是有一种运行/构建/发布此项目的方法,但是目前,我发现最好的方法是选择文件,然后执行运行文件" CTRL + SHIFT + F10.这工作了一段时间,但是现在我有一个外键以错误的顺序运行.我不想像在文件名前加上整数来强制执行特定顺序一样,使黑客行为变得毫无用处.感觉真是太棒了.

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.

我应该如何做到这一点,我肯定错过了一些东西,因为这种选择非常手工且容易出错.如果很重要,我要使用的数据库是Oracle.

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.

推荐答案

由于DataGrip 2020.1可以创建运行配置并指定数据源和多个文件或脚本:

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

请参阅 DataGrip博客文章.

这篇关于如何在Datagrip中加载或运行多个SQL文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆