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

Enhancement suggestion: inverted SELECT statements #1420

Open
truthdoug opened this issue Sep 27, 2023 · 1 comment
Open

Enhancement suggestion: inverted SELECT statements #1420

truthdoug opened this issue Sep 27, 2023 · 1 comment

Comments

@truthdoug
Copy link

Description

I love the autocompletion of pgcli. I love that it does completion of the columns I'm selecting after I've added the FROM tablename to the query. So, I typically type select 1 from tablename and then go back to the 1 to choose the columns I want.

My crazy idea is that pgcli should be a trailblazer for a new SELECT syntax:

FROM tablename SELECT column1, column2 WHERE column1 is not null...

By putting the table name first, it creates the necessary context for completing column names. pgcli can then rearrange the order of the query before sending to the server.

Joins would work similarly:

FROM table1 t1 JOIN table2 t2 on t1.id = t2.t1_id SELECT t1.name, t2.name WHERE t1.type = 'foo'

I acknowledge that this is crazy and a non-trivial enhancement... but thought I'd float the idea.

@radoslawklak
Copy link

I have same idea in mycli project: dbcli/mycli#1069 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants