Snowflake-Labs / sqltools-snowflake-driver

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

Cannot get schema if database have hyphen #31

Closed KreizIT closed 3 years ago

KreizIT commented 3 years ago

When trying to develop Schemas node, we get an error : 'sqltools.getChildrenForTreeItem' failed. Query in snowflake is :

SELECT schema_name as "label", schema_name as "schema", 'connection.schema' as "type", 'group-by-ref-type' as "iconId", catalog_name as "database"
FROM DATA-DEV.information_schema.schemata
WHERE schema_name != 'INFORMATION_SCHEMA' AND catalog_name = UPPER('DATA-DEV')
ORDER BY 2

This error is due to database name : DATA-DEV. In that case database name must be enclosed by double quote.

koszti commented 3 years ago

thanks for reporting this.

New version (0.4.2) with the fix is published to VSCode Marketplace and it should be now ready to upgrade in your VSCode.

You will need to put the database name in double quotes in the connection form: "DATA-DEV" and everything should work. Can you please confirm if it's working so we can close this issue?

KreizIT commented 3 years ago

Hello, Yes it's ok