Using DataGrip across multiple environments/data sources

I'm wondering if anyone has any tips on how they manage this.

When I'm working with a database, I may be making and testing changes in my dev environment (one data source) but also querying the live environment (a second data source) to check on data, existing schema, etc.

If I have a script file attached to my project which I have already run in one environment, it remembers that connection the next time I open it, making the possibility of running a script file in the wrong environment a bit too easy.  In the past, I've gotten round this by creating separate DataGrip projects for each of the environments but this seems clunky, and actually deprives me of some useful comparison tools.

It would be great to have a setting and/or command which clears all script file data sources either manually or on certain actions, like exiting the project - does anything like that exist?

And if anyone else works in this way, how do you manage working across environments with less danger?!

0
1 comment
You may consider setting your data sources to read-only, thereby preventing accidental changes before running your script.

Alternatively, you can adjust the SQL dialect scope for the SQL files folder so it doesn't associate any files with the given dialect's data sources.

Am I correct that your goal is to reset all data source connections set to your SQL Files after IDE restart?  
0

Please sign in to leave a comment.