Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new setting to let us specify what shows up in the results pane tab header #1268

Open
fuzl-llc opened this issue Dec 30, 2023 · 0 comments
Labels
feature request New issue opened using "Feature request" template

Comments

@fuzl-llc
Copy link

fuzl-llc commented Dec 30, 2023

Is your feature request related to a problem? Please describe.
When I run single query, the result pane tab displays the connection name followed by a colon, and then the beginning of the text of the query. E.g. "My Connection Name: select * from table..."

If I run multiple queries, there is one tab with "[connection name]: multiple query results" and then each tab header is the beginning of the query text.

In most cases, the query doesn't fit and gets cut off with a ... and worse, if there are multiple queries that start the same way you wouldn't be able to tell any difference in the tab text (and really that is a very useful thing to be able to have something descriptive in the tab headers).

I sometimes use a comment at the beginning of my queries and that shows up but, after the space used by the connection name and the comment characters, there isn't much actual useful info before the ... cuts it off.

I feel like displaying the connection name is not that useful, at least not for me, and I'd like to display something more useful that can quickly tell me what each query is and distinguish between similar queries.

Describe the solution you'd like
One thing that might be much more useful than the connection name would be to see the number of results (e.g. there is sometimes something like "1-16 of 16" in the bottom right corner) of the results pane. For me I see that results count text when I do single queries but not multiple queries and run the entire file... which is kind of weird. If I could just always have it in the tab, it would be very useful.

Even better, if you could have a setting for what to display in the tab and let us have tokens like "ConnectionName," "Query" (with the beginning text of the query as you're doing now), "ResultCount" (the "1-16 of 16" thing), and even "Comment" which would be the same as "Query" but, if your query has a comment at the beginning, it would show the contents of that comment which would be great for dynamically naming the tabs (e.g. just remove the preceeding "--" or "/*" and leading whitespace.

"[ConnectionName]: [Query]" would re-create the current default behavior for those that like it, and this could be the default value of this setting so there'd be no changes visually unless you go change this setting.

I'd love to be able to set it to "[ResultCount]: [Comment]"

That way, if I had table1 with 10 records and table2 with 20 records, and queries like this in a single file that I run all at once:

-- Display Stuff
select column1 from table1 limit 3;

-- Display Other Stuff
select column2 from table2 limit 15;

I could use this new setting with a value of "[ResultCount]: [Comment]"

I would get two tabs with the this text:
"1-3 of 10: Display Stuff"
and
"1-15 of 20: Display Other Stuff"

The above would be super clean and descriptive.

In retrospect, "Comment" maybe isn't needed and "Query" could just detect if the first line is a comment and remove the comment characters and whitespace.

I love the SQL Tools extension - thanks for creating it! I hope you'll consider this request.

@fuzl-llc fuzl-llc added the feature request New issue opened using "Feature request" template label Dec 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New issue opened using "Feature request" template
Projects
None yet
Development

No branches or pull requests

1 participant