sosedoff / pgweb

Cross-platform client for PostgreSQL databases
https://sosedoff.github.io/pgweb
MIT License
8.63k stars 732 forks source link

Fields autocomplete in sql editor #748

Closed sel-carlitos closed 2 months ago

sel-carlitos commented 3 months ago

Hi, First of all, I would like to thank you for this project! It's so great!!! I am so happy it's very light and super fast. I see that you have autocomplete for tables and views. I saw this PR https://github.com/sosedoff/pgweb/pull/449 but don't know how to adjust it to add fields in the autocomplete.

I would appreciate it if you could add field autocompletion to the SQL editor. It would make pgweb so much cooler and useful.

Thanks,

Carlos

sosedoff commented 3 months ago

Existing autocomplete solution will not work as expected with column names being fed into it, AFAIK. I think this is the main reason why it has not been implemented yet, the autocomplete needs to be smarter.

sel-carlitos commented 3 months ago

Are there any plans to implement it? Anyway to push for this feature? Can you provide me a clue as to where to look into it?

sosedoff commented 3 months ago

The PR you've linked is quite old, though as far as i remember the issue with bringing in all columns into autocomplete was related to the js module: it does not provide any way of configuring the nesting level, ie if i search "mytable." it should switch to autocompletion space for anything under "mytable" (cols, views, etc).Instead, it would always look up top level objects.

Maybe there were some changes in the dependencies of this project that would allow us to implement the column autocomplete, i just havent had any spare time to dig into it. Feel free to experiment tho.

sosedoff commented 2 months ago

Closing the issue to clear out the board of open issues.