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 option to return next #N rows when showing table records #365

Closed
dnlw07 opened this issue Sep 2, 2019 · 15 comments
Closed

Add option to return next #N rows when showing table records #365

dnlw07 opened this issue Sep 2, 2019 · 15 comments
Assignees
Labels
enhancement good first issue Easy issue for beginners to start contributing to the project
Milestone

Comments

@dnlw07
Copy link

dnlw07 commented Sep 2, 2019

Is your feature request related to a problem? Please describe.
Add option to return first 50 rows only, and add button in query result "return next 50 records" and "return all results"

@dnlw07 dnlw07 added the feature request New issue opened using "Feature request" template label Sep 2, 2019
@mtxr mtxr added enhancement good first issue Easy issue for beginners to start contributing to the project labels Sep 5, 2019
@mtxr
Copy link
Owner

mtxr commented Sep 5, 2019

Hi.

We currently have the option to return just the #N records. See:

I like the idea of paginating it. But meanwhile you can show the first #N records and if needs more, the query needs to be manually.

@mtxr mtxr changed the title Add option to return first 50 rows only Add option to return next #N rows when showing table records Sep 5, 2019
@mtxr mtxr removed the feature request New issue opened using "Feature request" template label Sep 5, 2019
@dnlw07
Copy link
Author

dnlw07 commented Sep 6, 2019

Thanks for feedback,
I have checked that setting, but I am afraid "limit": 100, is not working.

After applying that setting, querying a big table still returns its all results, instead first 100 only.

I need to manually add condition where rownum >100 to my SQL script to return first 100 only.

@mickeypearce
Copy link
Contributor

mickeypearce commented Oct 1, 2019

The limit applies only to "Show table records" command and not when executing a general query ("Run this file | query"), is that correct @mtxr?

With "Show table records" it works in my case. You can see the actual query executed if you click on "QUERY DETALS" at the bottom of the results grid (query ends with "....rownum <= 10", when you set "sqltools.results": { "limit": 10 }, to give an example).

@mtxr
Copy link
Owner

mtxr commented Oct 1, 2019 via email

@dnlw07
Copy link
Author

dnlw07 commented Oct 4, 2019

Yes, you are right.
However I believe it would be a nice option to add this functionality even for what user is typing (it does not to be a default behavior).
Many tools already have it, like SQL Developer or SQuirreL, etc.
I found myself it's a bit annoying to each time add/remove the additional filter condition rownum <= 100, to not "kill" DB.

@mtxr mtxr added this to the v0.22 milestone Nov 3, 2019
@mtxr mtxr assigned mtxr and unassigned mickeypearce Nov 3, 2019
@mtxr mtxr mentioned this issue Nov 3, 2019
@mtxr
Copy link
Owner

mtxr commented Nov 3, 2019

Since we don't want to change the query without his approval, let's add an alert first.

Requirements:

  1. Show an alert You are running a select query that has no limit clause, would you like to add it before continue? before changing the query.

@dnlw07
Copy link
Author

dnlw07 commented Nov 3, 2019

Yeah, good idea!
By default the alert should be always shown.
However, please consider the option to turn off the alert in settings.

@mtxr
Copy link
Owner

mtxr commented Nov 3, 2019

You are totally right. Evolving requirements:

Requirements:

  1. Show an alert You are running a select query that has no limit clause, would you like to add it before continue? before changing the query.
  2. Add an option to ignore this alerts

@mtxr
Copy link
Owner

mtxr commented Jun 11, 2020

Done on v0.22. Closing

@mtxr mtxr closed this as completed Jun 11, 2020
@johndevedu
Copy link

@mtxr which version of v0.22 has this? Could not find it in the changelog. I'm currently on v0.22.9 and wondering what the syntax is for enabling this feature. Thanks!

@mtxr
Copy link
Owner

mtxr commented Jun 24, 2020

Hi @johndevedu , it's the first version, it's enabled by default also so you should be seeing this on any queries resulting in rows number bigger than the limit

@johndevedu
Copy link

@mtxr I am not getting the alert when doing a select query on 0.22.9. I have the limit set to:

  "sqltools.results": {
    "limit": 20
  }

@mathief123
Copy link

Hi! I'm also not getting the alert, is it fixed yet?

@vibhavagarwal5
Copy link

vibhavagarwal5 commented Dec 19, 2022

Is this working? I dont see any alerts. @mtxr @gjsjohnmurray how to auto set limits while running query? can the extension auto set limit to queries?

@gjsjohnmurray
Copy link
Collaborator

My searches of the codebase didn't find this implemented anywhere. @mtxr did I miss something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue Easy issue for beginners to start contributing to the project
Projects
None yet
Development

No branches or pull requests

7 participants