snow helpers check-snowsql-env-vars¶
Check if there are any SnowSQL environment variables set.
Syntax¶
Arguments¶
None
Options¶
--format [TABLE|JSON|JSON_EXT|CSV]Specifies the output format. [env var: SNOWFLAKE_CLI_OUTPUT_FORMAT | config: cli.output_format]. Default: TABLE.
--verbose, -vDisplays log entries for log levels
infoand higher. Default: False.--debugDisplays log entries for log levels
debugand higher; debug logs contain additional information. Default: False.--silentTurns off intermediate output to console. Default: False.
--enhanced-exit-codesDifferentiate exit error codes based on failure type. Default: False.
--decimal-precision INTEGERNumber of decimal places to display for decimal values. Uses Python’s default precision if not specified. [env var: SNOWFLAKE_DECIMAL_PRECISION].
--helpDisplays the help text for this command.
Usage notes¶
This command only prints suggested Snowflake CLI mappings. It doesn’t set or migrate environment variables.
It treats a snowsql prefix without regard to case. Only the exact uppercase names in the map get a suggestion. On Windows, the operating system stores environment-variable names in uppercase, so snowsql_account is read as SNOWSQL_ACCOUNT. The command handles these names as follows:
EXIT_ON_ERRORisn’t printed, because that name doesn’t start withsnowsql.snowsql_accountis reported unused on Unix-like systems, where the lowercase name is preserved. Only the exact uppercase nameSNOWSQL_ACCOUNTgets a suggestion. On Windows, that lowercase name is already uppercase, so the command suggestsSNOWFLAKE_ACCOUNT.SNOWSQL_PASSWORDis reported unused. The known password name isSNOWSQL_PWD.SNOWSQL_ACCOUNTNAMEis reported unused. The documented name isSNOWSQL_ACCOUNT.SNOWSQL_REGIONis suggested asSNOWFLAKE_ACCOUNT(account identifier, not the region name). Put the account identifier inSNOWFLAKE_ACCOUNTor on the imported connection’saccount. Don’t copy the region name into the account. A region value already in the SnowSQL file is imported asregion. The default Snowflake CLI doesn’t readSNOWSQL_REGIONorSNOWFLAKE_REGIONwhile connecting.SNOWSQL_PROXY_HOSTis suggested asHTTPS_PROXY or HTTP_PROXY host.SNOWSQL_PROXY_PORT,SNOWSQL_PROXY_USER, andSNOWSQL_PROXY_PWDare suggested asHTTPS_PROXY or HTTP_PROXYfollowed byport,username, orpassword. Those SnowSQL proxy variables aren’t read while connecting.
For the connection mappings the default Snowflake CLI connection behavior reads, see Manually migrate your environment variables.
Examples¶
-
This example assumes a user has defined the following environment variables:
-
SNOWSQL_USER: Username for the connection. -
SNOWSQL_ROLE: Role for the connection. -
SNOWSQL_UNUSED: Variable not used in Snowflake CLI.