Manage Your Database Schema in IntelliJ IDEA 12
December 19th, 2012 by Andrey CheptsovAs you know, IntelliJ IDEA provides built-in database tools with support for many SQL dialects, such as Oracle, PostgreSQL, MySQL, Microsoft SQL Server and others.
A while ago we shared this video with a quick overview of how to set up a connection to a database, use smart completion (even for SQL queries within Java), on-the-fly code analysis, navigation (between queries and database), search (for tables and fields), and more cool features.
Now, please enjoy a new video with even more exciting features available in IntelliJ IDEA 12 for working with databases:
Manage Your Database Schema from the IDE
Now you are able to define tables, columns, indexes and foreign keys simply from the Database tool window via the shortcut (Ctrl+N) or the context menu.

Create New Table
The new table wizard brings code completion and SQL preview with support for all listed dialects, so you can define a new table for any database in seconds.

Modify Column
If you modify a column (Cmd+F6), the IDE will automatically show you how your changes affect the project and will apply the appropriate changes to the code.

Transaction Control
The table editor and query console support manual transaction control, so you can commit more than one change at once or roll it back safely whenever you want.

Data Export
Data from the table editor or query results may be exported to a file or clipboard in the following formats: CSV, TSV, HTML, SQL Insert/Update statements.
CSV Editor
If you open a CSV file in the editor, the IDE will offer you to edit data in a table.

Quick Documentation
The Database tool window also provides the Quick Documentation action via Ctrl+J for any selected element from the database. The popup window shows the SQL definition for selected item and the first 10 rows (for tables and views).

As databases are part of most projects today, it was about time for us to help developers work with them more productively. Find these and many other features for database development in the latest release of IntelliJ IDEA.
Feel free to share your feedback with us in our discussion forum and in our issue tracker.
Develop with Pleasure!
Tags: Database, Database Tools

December 19th, 2012 at 7:21 am
Pretty cool. Is there also a possibility to, instead of creating DDL, create liquibase migrations?
December 19th, 2012 at 7:59 am
@Erik a brand new migration action is available from the database diff dialog.
December 19th, 2012 at 9:17 am
Is there sqlite support? I like to mock databases before implementing them in Android.
December 19th, 2012 at 9:28 am
@Chris Yes, SqlLite is supported!
December 19th, 2012 at 1:12 pm
Any intention to add UML/ERD abilities to Intellij for databases?
December 20th, 2012 at 11:55 am
How about adding an option to tunnel through SSH when connecting? I know there are ways to get it working, but it really needs to get built into the UI.
December 20th, 2012 at 12:38 pm
very nice is there a way to create a table with the primary key auto incrementing?
December 20th, 2012 at 9:36 pm
I’m having difficulty getting the csv editor to work.
When I specifically save a csv file from the database browser it comes up with the csv editor. If I open up a csv file otherwise, it just uses the standard text editor.
I’ve tried removing .csv from the Text filetypes but that didn’t help.
January 2nd, 2013 at 1:28 am
@jetbrains..I think one feature that would immensely help is autocomplete table names in console (CTRL + Space) - any plans of getting it or is it simply something i am missing.
January 10th, 2013 at 5:56 pm
I second @ Daemon’s request regarding an SSH feature. I currently use Navicat for database related tasks which has an SSH tunnel feature out of the box.
March 3rd, 2013 at 4:22 pm
I’m Using IntelliJ Idea 12, in the database designer I’m connecting an SQLite database but designer shows all my fields as TEXT except the decimal ones, is there any issue to let the designer retreives the right types of my fields?
May 16th, 2013 at 11:13 pm
from http://www.sqlite.org/datatype3.html
most used data type stored in sqlite3 is just TEXT:
CHARACTER(20)
VARCHAR(255)
VARYING CHARACTER(255)
NCHAR(55)
NATIVE CHARACTER(70)
NVARCHAR(100)
TEXT
CLOB
DATETIME stored as TEXT if its ISO8601 strings (”YYYY-MM-DD HH:MM:SS.SSS”).
May 20th, 2013 at 9:39 am
Hi,
Maybe I’ve missed it - but I couldn’t find an easy way to save the text of a query I right in the SQL console to a file.
So for example. I load up the SQL Console, I write my query and execute it. I want to save it for later … Seems like a pretty standard user case, but the only way I can seem to do it at the moment is by creating a new SQL file and then copy and pasting my query into it. Any ideas or is this a missing feature?