SQL Support for Java Development
IntelliJ IDEA supports SQL scripts with the complete range of its coding assistance features:
smart completion for keywords, table and column names, syntax and error highlighting and more.
Plus, Rename refactoring also recognizes and updates table and column names.
Supported SQL Dialects
IntelliJ IDEA supports SQL-92, Oracle, MySQL, SQLite, PostgreSQL and Derby SQL. You can set a dialect at project, folder and individual file levels — either via Project Settings section of Settings dialog:
Or by invoking a quick-fix on any error marker inside of an .sql file with Alt+Enter shortcut:
Database UML Diagram
SQL Coding Assistance
Code completion, syntax and error highlighting all make IntelliJ IDEA a perfect SQL editor.
SQL coding assistance works not only in .sql files, but also in Java and other code, and recognizes the database structure.
Built-in SQL Query Console
IntelliJ IDEA features an SQL console that combines a powerful SQL editor with a built-in query runner.
In this dedicated window, you can run and debug SQL scripts.
It can be effectively used as a full-scale SQL query editor, with complete SQL coding assistance.
SQL Data Sources Support
IntelliJ IDEA is capable of providing full SQL coding assistance based on your database structure, without actually connecting to a database. It's enough to provide the .sql file containing your database definition statements.
- IntelliJ IDEA treats SQL data sources the same way as JDBC.
- SQL data sources can include tables from other data sources.
- You can drag and drop sql files from project view to Database toolwindow to quickly create SQL data source.