IntelliJ IDEA 2017.2 Help

SQL Resolution Scopes

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.

Settings

ItemDescription
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 /help/img/idea/2017.2/add.png and select the file or directory in the dialog that opens. Then click /help/img/idea/2017.2/edit1.png or the Resolution Scope cell, and select the necessary data sources, databases and schemas.

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.

Last modified: 11 October 2017