Vscode-sqltools: Run the query and show results in a new window

Created on 11 Apr 2019  路  7Comments  路  Source: mtxr/vscode-sqltools

When I execute a single query, it would be great if I can choose whether the results show in a new tab or in the current result tab. Sometimes I'd like to compare the next results with the previous.

Desired solution
For example,
select query 1, pressing command + E + E gives results in a tab.
select query 2, pressing command + E + W gives results in a new tab beside the previous.
So I can make comparisons between the results of query 1 & 2.

feature request uux

Most helpful comment

I like where are you going with this.

I have just a problem I need to understand how to fix, it's in the core of the extension because we are using webviews to render the results and VSCode team says it is very memory hungry.

Some questions, you might already have an answer for that.

  1. What do you expect to happen if you run the same query twice? Same tab, other tab or any other behavior?
  2. When we run multiple queries, we group them in the same output window and present the last ran query with internal tabs to switch. What do you expect to happen in this case? Keep the behavior, open all in new vscode tabs or internal tabs..

All 7 comments

I like where are you going with this.

I have just a problem I need to understand how to fix, it's in the core of the extension because we are using webviews to render the results and VSCode team says it is very memory hungry.

Some questions, you might already have an answer for that.

  1. What do you expect to happen if you run the same query twice? Same tab, other tab or any other behavior?
  2. When we run multiple queries, we group them in the same output window and present the last ran query with internal tabs to switch. What do you expect to happen in this case? Keep the behavior, open all in new vscode tabs or internal tabs..

Thanks for the reply.

I think that most of the time it is sufficient to present the results in one window/tab (just like now). Occasionally, users may like to run a query with the result showing in a new tab. For this case, a special run command/shortcut would be enough.
A bit like that you can choose to _open a link in the current tab_(left click) or _a new tab_(middle click) when using Chrome.

  1. It would totally depend on how users run that query (no matter same or different), normal run command gives the result in the same tab, special run (in new tab) command gives the result in a new tab.

  2. multiple queries are likewise, normal run group them in the same output window and present the last ran query with internal tabs to switch, special run (in new tab) do the same thing but in a new output window.

Basically, keep everything as the current, add a new run (in new tab) command/shortcut that returns output in a new tab. Hope I make it a bit more clear :D

Got it!

I'll work on it after #188 .

I like your idea a lot

I don't know if this is possible, but for me to have the query results pop up in the panel instead of a tab would be A+. I often have my tabs in different groups and I have to move the query results around. The panel has a wide layout that suits table layouts and you could show hide it as necessary. Just my 2c :).

@christiangun I think this is what happens now if you configure the settings in JSON to:

"sqltools.results": {
        "location": "beside"
    }

.. with the curious side-effect of not surviving vscode restarts very well - it leaves the empty space where the SQL results panel was, but connecting and executing a piece of SQL opens a new panel, leaving the empty space behind. This might be a bug that needs reporting separately, now that i think about it.

EDIT: opened one - https://github.com/mtxr/vscode-sqltools/issues/211

@ransagy I find that setting more intuitive than the default, so thanks for the tip :). But I was thinking about the panel that the terminal, debug output etc. is in. I don't want to hijack the original issue here though, just wanted to put the thought out there.

Hey guys, I'll close this issue. So far VSCode doesn't support anything new about this behavior.

Everything they provide for opening and selecting where to open is already implemented in the extension (if I'm not wrong).

Since now we can have one result window per connection, I'll consider this closed.

I'm tracking some issues in their repo about layout, if they decide to work in any of then, I'll certainly add this the SQLTools.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sideshow-systems picture sideshow-systems  路  4Comments

BrendanSimon picture BrendanSimon  路  3Comments

abenhamdine picture abenhamdine  路  6Comments

ransagy picture ransagy  路  5Comments

tchase56 picture tchase56  路  4Comments