IntelliJ IDEA 2017.1 Help

SQL Dialects

File | Settings | Languages and Frameworks | SQL Dialects for Windows and Linux
IntelliJ IDEA | Preferences | Languages and Frameworks | SQL Dialects for macOS


This page lets you specify the SQL dialects (DBMS-specific versions of SQL) used in various scopes.

Dialect settings

ItemDescription
Global SQL Dialect The SQL dialect for all the .sql and .ddl files on your computer; may be redefined in narrower scopes - at the project level, and/or for individual files and directories.
Project SQL Dialect The SQL dialect for all the .sql and .ddl files in your current project. If <None> is specified, the global SQL dialect is inherited.
Path / SQL Dialect The SQL dialects for individual files and directories - if different from the global or project dialect.

If nothing is specified in this section, all the .sql and .ddl in your project inherit the project dialect, and all the files that are outside the project - the global dialect.

To specify a dialect for a file or directory, click /help/img/idea/2017.1/add.png and select the file or directory in the dialog that opens. Then click /help/img/idea/2017.1/edit1.png or the SQL Dialect cell, and select the dialect.

The dialects specified explicitly are shown in black. The inherited dialects (unless you close the dialog) are shown in gray italic.

Dialect options

When specifying a dialect, in addition to particular dialects, you can select:

  • <None> or <Clear>. As a result, a dialect from a higher level is inherited.
  • <Generic SQL>. This means that no particular dialect is specified. As a result, basic SQL92-based coding assistance is provided including completion and highlighting for SQL keywords, and table and column names. Syntax error highlighting is not available. So the file contents are always shown as syntactically correct. Also, automatic code reformatting isn't possible.

Example

Say, most of the SQL script files on your computer are for PostgreSQL. In the current project, you are developing the scripts for Oracle but in one of the directories in your project there are the scripts for MySQL. In such a situation, you'd specify:

  • Global SQL dialect: PostgreSQL
  • Project SQL dialect: Oracle
  • <PathToMySQLScriptsFolder>: MySQL

See Also

Language and Framework-Specific Guidelines:

Last modified: 18 July 2017