Skip to content

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

@takemyoxygen

Description

@takemyoxygen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions