-
Notifications
You must be signed in to change notification settings - Fork 80
Description
Describe the bug
It seems like sqls has trouble with code completions and hover when dealing with a table outside of the public schema in Postgres. Both actions work fine for me for tables in the public schema, but return no results for tables in other schemas.
To Reproduce
Create a table in the default public schema, and one in another schema:
CREATE TABLE cat (
age integer,
owner_name varchar(40)
);
CREATE SCHEMA my_schema;
CREATE TABLE my_schema.owner (
age integer,
name varchar(40)
);Write a query involving the two tables and experiment with completion on each table through sqls:
SELECT
cat.age AS cat_age,
owner.age AS owner_age
FROM
cat
JOIN
my_schema.owner AS owner
ON cat.owner_name = owner.name;In particular, try to complete from owner. or my_schema.owner.. Also try to perform a hover action over owner.
Expected behavior
I would expect completion to work on both the cat and owner tables. Instead, it only works on cat. This is true regardless of whether the full my_schema.owner. prefix is used or the owner alias. Similarly, I would expect textDocument/hover to work for both cat and owner, but it only works for cat.
Versions (please complete the following information):
- OS Version: Linux 5.17.1
- sqls Version: 0.2.22