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).

This entry was posted in New Features and tagged , . Bookmark the permalink.

15 Responses to Database Access Improved

  1. deaddowney says:

    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. deaddowney says:

    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. Gregory Shrago says:

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

  4. Tilman says:

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

  5. Gregory Shrago says:

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

  6. Bobby Eickhoff says:

    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. drypot says:

    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. Taras Tielkes says:

    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. Gregory Shrago says:

    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. Jorge_Tejada says:

    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. Developer says:

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

  12. Gregory Shrago says:

    @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. erez says:

    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. Gregory Shrago says:

    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. “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?

    Thanks
    Mark

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>