Thread: Feature requests: QueryTool; key shortcut, output pane unhiding, macros

Feature requests: QueryTool; key shortcut, output pane unhiding, macros

From
Jan Kowalski
Date:
I'm using SQL Server Management Studio at work, and now when I'm doing 
little open source project at home, I miss a few features.

1. Key shortcut that shows/hides "Output pane". In the other program its 
Ctrl-R.

2. In the other program, if "Output pane" is hidden and I run a query, 
"Output pane" shows up.

3. Keyboard macros. In the other program they can do marvels. Here is 
how they work.

In MS SQL, Stored Procedures, if there is SELECT query with no INTO 
clause inside routine,  its results are shown in "Output Pane"'s "Data 
Output" tab. User can bind routine name to key-combo (Ctrl-F1, Ctrl-0 to 
Ctrl-9). When key-combo is hit. Routine is called, if there is selection 
in editor, its passed to routine as an argument. Results of that 
routine, are shown in "Data Output" of current QueryTool. A few well 
crafted routines makes development lot easier for example:
One shows all routine, view and table names that matches to pattern 
(passed as argument).
One scripts routine or view, and wraps its code with three procedures 
that do revision management.
One shows all columns of table or view, with "v." prefixes and ", " 
suffixes, so that writing views takes less time.
Other shows first 15 rows of selected table.
Possibilities are endless.

PostgreSQL procedures are little different than T-SQL equivalent, 
therefore I propose different approach.
There should be place (in Options Dialogue) to write whole SQL query 
that will be bound to the key. When I hit key combo, if there is a place 
holder in the query, its filled with current selection, and then query 
is passed to server. Query results are passed to Output Pane, just like 
after normal "F5" query execution.
There should be no quoting of arguments, we assume that this 
functionality would be used by advanced users. If they want to create 
macro that drops table passed as "selection argument" we should not 
interfere.

I can write all needed SQL functions, but I've never done any serious 
GUI programming.


Jan Kowalski wrote:
> I'm using SQL Server Management Studio at work, and now when I'm doing 
> little open source project at home, I miss a few features.
> 
> 1. Key shortcut that shows/hides "Output pane". In the other program its 
> Ctrl-R.

Ctrl-Alt-O now in SVN trunk.

> 2. In the other program, if "Output pane" is hidden and I run a query, 
> "Output pane" shows up.

Done.

> 3. Keyboard macros. In the other program they can do marvels. Here is 
> how they work.

Nice idea. It's a bit late to do that for the next release, but I've put 
it on the todo list.

Thanks, Dave