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

Default ready to use SELECT TOP query #331

Open
enricobenedos opened this issue Sep 17, 2024 · 4 comments
Open

Default ready to use SELECT TOP query #331

enricobenedos opened this issue Sep 17, 2024 · 4 comments
Labels
enhancement New feature or request hacktoberfest Eligible for Hacktoberfest 2023!~ open source

Comments

@enricobenedos
Copy link

Is your feature request related to a problem?

We think that one of the common operations users/developers want to execute on the database during developing phases, but also on production, is a fast view of table records. At the moment we need to rewrite always the same base query that is always:
SELECT * FROM my_beautiful_table. And then add something like "ORDER BY timestamp DESC".

This is a little bit annoying compared to other databases GUI clients.

Describe the solution you'd like.

We would like to have a new item in every table context menu like "Select TOP 1000 rows" (like Microsoft MSSQL) or "View Data" (like DBeaver). That can simply generate the query and add it to the text editor.

The additional feature could be having two more options when a table have a timestamp index that permits to select first top n items in ascending or descending order.

Describe alternatives you've considered.

No response

Full Name:

Enrico Benedos

Affiliation:

Deimos

Additional context

No response

@nwoolmer
Copy link

Hi @enricobenedos ,

You can get a similiar effect with table_name LIMIT -1000. This will give you the last 1000 rows, but sorted in ascending order.

In general, any query which is just a simple SELECT * FROM can have that part of the clause omitted. The table_name implicitly represents the table with SELECT * FROM in front.

In the meantime, I'll shift this to the UI repo since it is solely a UI change!

@nwoolmer nwoolmer transferred this issue from questdb/questdb Sep 17, 2024
@nwoolmer nwoolmer added enhancement New feature or request open source labels Sep 17, 2024
@enricobenedos
Copy link
Author

Thank you @nwoolmer

Mine is only a suggestion because during the week, me and my colleagues, rewrite always the same stuff that we don't need to do with other clients . The most common thing to do before write the real query is always the same stupid select to take a look at the data 🥲

@javier javier added the hacktoberfest Eligible for Hacktoberfest 2023!~ label Oct 2, 2024
@TSP06
Copy link

TSP06 commented Oct 22, 2024

hey @enricobenedos i would like to work on this

@enricobenedos
Copy link
Author

enricobenedos commented Oct 22, 2024

Hello @TSP06, your PR is welcome 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest Eligible for Hacktoberfest 2023!~ open source
Projects
None yet
Development

No branches or pull requests

4 participants