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

Autocomplete not working for Apache AGE extension function names #1453

Open
3 tasks done
rafsun42 opened this issue Feb 29, 2024 · 1 comment
Open
3 tasks done

Autocomplete not working for Apache AGE extension function names #1453

rafsun42 opened this issue Feb 29, 2024 · 1 comment

Comments

@rafsun42
Copy link

rafsun42 commented Feb 29, 2024

Description

Hello,

I am interested in trying the PG extension Apache AGE with pgcli. Almost all uses of the extension is via the functions it provides. So, it would be really useful if pgcli could autocomplete AGE's functions. However, it does not. I have tried adding AGE's catalog to the search path, but that didn't work. It seems the autocomplete feature relies on the file pgliterals.json to get the function names.

Can anyone guide me how to enable this functionality in case I am missing something?

In case this functionality is not there, I am interested in helping implement it. The basic idea is to allow PGCompleter to dynamically query pg_proc table for function name lookups. Any thoughts?

--
Rafsun Masud
Apache AGE contributor: https://github.com/apache/age

Your environment

OS: Ubuntu 22.04
CLI: compiled the main branch

  • Please provide your OS and version information.
  • Please provide your CLI version.
  • What is the output of pip freeze command.
@j-bennet
Copy link
Contributor

j-bennet commented Mar 3, 2024

Hi @rafsun42,

We're already querying pg_proc to suggest function names:

def functions(self):

Then pgcompleter has some additional logic on top of that:

def get_function_matches(self, suggestion, word_before_cursor, alias=False):

It could be and not f.is_extension that trips you up:

and not f.is_extension

Try removing that and see if it helps. I can't tell for sure now, but I think we originally added that clause because some extensions add a huge number of functions, and it becomes cumbersome for the user to scroll through a huge list.

If that resolves your problem, we can probably make it a configuration option.

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