Database Access Improved

The latest IntelliJ IDEA 9.0.2 EAP contains a big number of Database-related functionality changes:

  • Database Console now has its own toolwindow
  • New console-like UI that keeps input and output in one place and retains the highlighting for execution history
  • Keyboard shortcuts for all Console actions are now configurable
  • Per-result Page Up, Page Down and Refresh actions
  • Complete support for In-Memory Databases (try running some DDL in Console then click Refresh Tables and all the tables will be loaded in the Data Sources tree)
  • Improved support for heavy JDBC drivers that use native libraries to run
  • The notion of Database Connection allows IntelliJ IDEA to do some cool stuff such as Quick Table Contents Lookup integrated with Quick Documentation Lookup (Ctrl+Q)

The Hibernate Console has also been improved accordingly (separate toolwindow, console-like UI and per-result paging actions).

Try all this in the latest EAP and let us know what you think.

UPD: In the next EAP SQL scripts can be run directly from Project View or Editor via Run SQL Script (Ctrl+Shift+F10).

Comments below can no longer be edited.

15 Responses to Database Access Improved

  1. Avatar

    deaddowney says:

    March 1, 2010

    I would love to be able to hit up and get my previous query (like bash history).

    It would also be nice to be able to right click on a table and select * or top 100 rows.

  2. Avatar

    deaddowney says:

    March 1, 2010

    Also supporting displaying schemas as folders would be nice, e.g. instead of putting all the tables at one level, grouping tables by schema.

  3. Avatar

    Gregory Shrago says:

    March 2, 2010

    You can get the previous queries using Ctrl+Up/Ctrl+Down.

  4. Avatar

    Tilman says:

    March 4, 2010

    I would rather see the last sql command remaining in the editor (like it was before) …and the history list appearing by keystroke

  5. Avatar

    Gregory Shrago says:

    March 4, 2010

    The last command will remain in the editor if you use “Execute Current” (Ctrl+Shift+Enter).

  6. Avatar

    Bobby Eickhoff says:

    March 9, 2010

    Looks good. The first couple of times I launched the Database Console, I used the icon on the Data Sources toolbar, and the resulting console refused to execute any queries. However, after I launched the console by right-clicking in the list of database tables and selecting it from the contextual menu, everything worked fine. Not sure what went wrong.

    As with the previous version, I have been annoyed by having to set the SQL Dialect every time I open the Database Console; it always defaults to Plain Text, and I always change it to SQL92. Is there any way to persist this setting for a particular data source or all data sources?

  7. Avatar

    drypot says:

    March 11, 2010

    SQL Developers does not work this way.

    1. make JDBC Datasource in IDE
    2. make new MyScript.sql file.
    3. link MyScript.sql file to JDBC Datasource (with choice box on editor in upper side)
    4. write some sql scripts
    5. run whole sql script or current statement (separated by blank line or 😉
    6. check result in result window
    7. modify script in MyScript.sql
    8. rerun script in MyScript.sql

    with current console window design, I can’t save my script without copy & paste.
    and inconvenient to run eveyday sql script with 200~300+ lines.

  8. Avatar

    Taras Tielkes says:

    March 12, 2010

    Fully agree with comments provided by “drypot” above.

    I expect to use a regular editor window to edit SQL.
    A tool window should only appear to show query results.

    The SQL code completion provided by IDEA is pretty nice though 🙂

  9. Avatar

    Gregory Shrago says:

    March 15, 2010

    Starting from the next 9.0.2 EAP there’s a “Run SQL script” action available in Project View and Editor. Standard shortcut as for other run operations is Ctrl-Shift-F10 (configurable). It is designed for long scripts therefore no data output just DBMS reports.

  10. Avatar

    Jorge_Tejada says:

    April 26, 2010

    Is there any way to see Hibernate SQL generated queries like in 9.0.1 HQL Console? other issue is that the HQL query recently typed doesn’t remain in the console for editing

  11. Avatar

    Developer says:

    April 28, 2010

    Is there any way to enable “Database Console” toolwindow within Grail project?
    I cannot find the path to do that. 🙁

  12. Avatar

    Gregory Shrago says:

    May 4, 2010

    @Jorge_Tejada: “Generate SQL” action in Hibernate Console works the same way as in 9.0.1. Ctrl+UP/Ctrl+Down restores previously executed queries.

    @Developer: Tools/Data Sources menu item if it’s the first time you create Data Source.

  13. Avatar

    erez says:

    May 27, 2010

    I reinstalled IDEA with database plugin enabled and since then i do not have the ‘database’ tab anywhere.
    in the plugin manager the database plugin is enabled..

    anyone knows how to get access to it?

  14. Avatar

    Gregory Shrago says:

    May 31, 2010

    If you have no Data Sources configured the tab is accessed via Tools/Data Sources. This is done to save tab bar space in case this functionality is not needed.

  15. Avatar

    Custom Software Development, Gold Coast, Australia says:

    August 10, 2010

    “It would also be nice to be able to right click on a table and select * or top 100 rows”

    Good idea, what about the ability to easily load / save SQL queries instead of having to copy and paste between windows?


Discover more