Snowflake-Labs / sqltools-snowflake-driver

A Snowflake driver for the SQLTools VSCode extension.
MIT License
35 stars 15 forks source link

Connecting gives a 'cannot get database list' message #3

Closed datadutch closed 3 years ago

datadutch commented 3 years ago

When setting up a connection from VSCode with Snowflake, the password validation passes (at least when typing a wrong password, it is explicitely mentioned that the password is wrong). I get the error message: cannot get database list. In the Snowflake query history, I cannot see any query being executed. Setting this up on another account, where I have SYSADMIN privileges, the connection is succesfull, I also can see al queries in the Snowflake query history window. What priviliges are required to set up the connection?

koszti commented 3 years ago

Is the database name correct in the connection form?

The test connection button runs two queries (source code here):

SHOW DATABASES;
SELECT * FROM TABLE(RESULT_SCAN(LAST_QUERY_ID())) WHERE UPPER("name") = UPPER('<DBNAME_IN_CONN_FORM>');

If this returns zero row, then you see the cannot get database list error. What is the output when you run the above two queries from the snowflake UI as SYSADMIN?

Make sure you're not running anything between the two queries otherwise it will confuse the LAST_QUERY_ID() function.

koszti commented 3 years ago

Another idea, and maybe the real reason of the problem. Does the SYSADMIN user has a default warehouse?

If not then can you please try to fill the warehouse in the connection from and click test connection again? I think we need to make the warehouse field mandatory.

koszti commented 3 years ago

I've published a new version of the snowflake driver (0.2.0) to vs marketplace that makes the warehouse connection parameter mandatory and hopefully fixes your issue.

Can you please update the driver in your vscode and try again?

datadutch commented 3 years ago

does VSCode automatically install updates for extensions ? I see that it is om 0.2.0 now ?

it is working now, thanks for the update

koszti commented 3 years ago

does VSCode automatically install updates for extensions ? I see that it is om 0.2.0 now ?

depends on the vscode settings, but AFAIK automatic update of extensions is enabled by default