vscode-sqltools icon indicating copy to clipboard operation
vscode-sqltools copied to clipboard

Autocomplete problems seen with the "Redshift Driver (Dedicated ver)" extension

Open gjsjohnmurray opened this issue 1 year ago • 2 comments

Hello, I am using your "SQL Tools" extension in visual studio code along with the "Redshift Driver (Dedicated ver)" extension to connect to my data.

When working in a .sql file I first attach the .sql file to my active redshift connection. I am able to run queries within this .sql file, but when typing something as simple as "SELECT * FROM schema_a." no table names are suggested. In other SQL IDE's table names are suggested after typing "schema_a.".

Similarly, after picking the right table, column names are not suggested in the select statement of my query. For example, my query is something like "SELECT tbl_b.* FROM schema_a.table_b tbl_b". Upon typing "tbl_b." no column names are suggested.

I have tried typing ctrl+space to force the table names and column names to show up, but SQL tools returns "Loading..."

Is there a simple solution that I am missing? Thanks in advance!

Originally posted by @Data-Science-Link in https://github.com/mtxr/vscode-sqltools/issues/110#issuecomment-1252898329

gjsjohnmurray avatar Sep 20 '22 21:09 gjsjohnmurray

Does the SQLTools channel of your Output tab give any clues about what's happening when you manually trigger the lookup with ctrl+space?

I'm not seeing similar problems with the standard PostgreSQL driver, so you might need to report this to the author of the dedicated driver.

gjsjohnmurray avatar Sep 21 '22 13:09 gjsjohnmurray

@gjsjohnmurray thank you for the reply.

I tried using ctrl+space again. I had more patience this time. Upon waiting 20-30 seconds after pressing ctrl+space intellisense in sql tools gave me table options under a schema.

Similarly, in the select statement I wrote the table alias then ".", pressed ctrl+space, and had to wait ~45 seconds for column names to be suggested by intellisense.

Do you have any idea on why it is taking so long for table and column names to be suggested? Is this an issue with "SQL tools" extension, the "Redshift Driver (Dedicated ver)" extension, or something else? Any guidance would be appreciated!

Data-Science-Link avatar Sep 21 '22 19:09 Data-Science-Link

This file holds the queries that the driver runs on behalf of the main extension:

https://github.com/kj-9/sqltools-redshift-driver/blob/main/src/ls/queries.ts

Maybe they can be made more efficient.

gjsjohnmurray avatar Sep 22 '22 08:09 gjsjohnmurray

@Data-Science-Link if you want to pursue this please open an issue on the extension repo at https://github.com/kj-9/sqltools-redshift-driver and maybe link to this one.

I'm closing this here.

gjsjohnmurray avatar Sep 28 '22 09:09 gjsjohnmurray