Skip to content

Completions don't work when querying from a table having more than one "." in the name. #1453

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

Open
1 task done
takemyoxygen opened this issue Mar 15, 2025 · 1 comment
Open
1 task done
Labels

Comments

@takemyoxygen
Copy link

Describe the bug
Completions don't work when querying from a table having more than one "." in its name.

When typing a query like

SELECT * FROM foo.bar.baz
WH

there are no completions, (e.g. no suggestion for WHERE keyword).
Technically, this happens because genericAutocompleteParser from gethue considers this query as invalid and doesn't provide any suggestions (even the latest version of gethue, 6.0.1, has this problem). Output of the SQLTools extension has lines like

[1742040342252] INFO  (ls): completion requested {"line":1,"character":6}
    ns: "intellisense"

but no completions is displayed. SQLTools doesn't call getStaticCompletions or searchItems of the underlying connection.

To Reproduce
Steps to reproduce the behavior:

  1. Write a query like SELECT * from database.schema.table

Expected behavior
Keywords completion and any completions provided by the underlying driver keep working

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • SQLTools Version 0.28.4
  • VS Code Version: 1.98.2
  • OS: Mac
  • Driver:
    • Any (I tested specifically on Trino)
  • Database version: [e.g. MySQL v5.6, PostgreSQL vX...]

Additional context
Additionally, some sql engines support having schemas/namespaces with dots in their names,
for example a Trino query like

SELECT * from memory."foo.bar.baz".orders

is a valid query wherememory is a catalog, a top-level entity; "foo.bar.baz" - schema in this catalog; orders is a table name. But it also breaks SQLTools completions.

@VadimMuhtarov
Copy link

I have the same problem when I need to use different databases in one connection

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

No branches or pull requests

2 participants