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 ?
Create a query consoleClick a data source and select File | New | Query Console. Right-click a data source and select New | Query Console. Click a data source, press Alt+Insert , and select Query Console. Click a data source, press Ctrl+Shift+F10 , and select New Query Console.
Open the Project tool window (View | Tool Windows | Project) and double-click an SQL file. Click the statement that you want to execute.
Database tools and SQLUltimateThe database management functionality in IntelliJ IDEA is supported by the Database tools and SQL plugin. The Database tools and SQL plugin provides support of all the features that are available in DataGrip, the standalone database management environment for developers.
Right-click the editing area of the input pane, select Change Dialect, and select Generic SQL.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With