SQL Resolution ScopesUltimate
File | Settings | Languages and Frameworks | SQL Resolution Scopes for Windows and Linux
IntelliJ IDEA | Preferences | Languages and Frameworks | SQL Resolution Scopes for macOS
This page lets you specify the data sources, databases and schemas that should be used to resolve unqualified (short) names of database object in your SQL files.
note
For this page to be available, the Database Tools and SQL plugin must be enabled. See Manage plugins.
Settings
Item | Description |
---|---|
Project mapping | The set of data sources, databases and schemas used by default by all the SQL files in your project to resolve unqualified names of database objects. |
Path / Resolution Scope | Mappings for individual files and directories. If nothing is specified in this section, all the SQL files in your project use the project mapping. To specify a different mapping for a file or directory, click The mappings specified explicitly are shown in black. The mappings inherited from a higher level (unless you close the dialog) are shown in gray italic. |
Example
You have two data sources, one for your production database and the other one - for your test database. The tables in both databases have the same names but slightly different structures. And you keep the SQL scripts for your production and test databases separately, in two different folders.
In such a situation, you'd map the folder with the production scripts onto the production data source, and the folder with the test scripts onto the test data source.
The other possibility would be to use the project mapping for your production data source and specify the mapping for the test scripts folder separately, or vice versa.