5

Back to 12, if I remember correctly, when editing a SQL file in SQL editor, IntelliJ IDEA will ask me what dialect am I using, and inspect its syntax.

However, with the new database tool in 13, by default the SQL editor validate nothing, I can only auto complete keywords.

The Database and SQL support plugins are enabled.

Do I need to setup anything else in order to get it works in SQL editor ? or some other options I should make sure it is enabled ?

Rangi Lin
  • 9,303
  • 6
  • 45
  • 71

1 Answers1

12

First, make sure you have the necessary SQL dialect(s) configured in File > Settings > [Project Settings] > SQL Dialects.

Second, to get any code completion other than keywords (such as table and column names), IDEA needs to know about your database so it can index it. Thus you need to configure either a DataSource or DDL Source in the Database tool window. Take a look at my answer to a similar question about SQLite: How do I open a sqlite db file in my local disk in intellij 13 preview That has detailed steps (with screenshots) on how to configure a database via a DataSource. Using a DDL script is similar and should be self explanatory (just select the DDL file).

Community
  • 1
  • 1
Javaru
  • 30,412
  • 11
  • 93
  • 70