In almost every application we write and run, we have SQL being executed against a server. When debugging our applications, we often set our logging to display the SQL being executed, and just as often have to execute that SQL to insure that the results of the query is indeed what we are seeing in the debugger as being returned. This has been such a part of life as an enterprise developer for the past 25 years, that I never thought on how to make it easier to just now.
What I propose, is that IDEA support some simple mark-up tag, that identifies SQL, such as <sql></sql>. Then they extend the Console to recognize this tag, identifying the contents as executable sql. Additionally, the Console should have a pull-down to allow the user to choose between defined Data Sources, as the default target of executed SQL. Now, the simple part should be, when you click on the SQL in the log, it gets executed against the selected data source and comes up in a Data Source console.
In one simple fell swoop, we break this historical chain of copy paste into data base UI front ends to see what is going on.
I was not sure if this type of integration between the consoles content area, its controls, and the data sources would be a very easy thing to do as a plug-in. But if some of you think it is, maybe I should take a shot at it first before asking the IntelliJ guys to add it as a feature.
One additional feature, that I think would be excellent, would be to expose a simple api that allows a plug-in to register for the execution requests when a user clicks on the SQL, so we can add plug-ins to send the sql to our favorite third party UI tool. In my case, I use Oracle's SQL Developer a lot, and I would try and see if I could message over a sql request to it via an IDEA plug-in (I have no idea if that is possible, but as I work on Mac OS X, there is often some simply integration between apps using the Services menu.
BTW, the doc says that IDEA already supports execution of "Injected SQL Statements from the Editor", so similar support exists for SQL in the Code Editors. This therefore may be a very simple extension of that existing infrasturcture.