Closed SoheilSalmani closed 1 week ago
SNOWFLAKE_AUTHENTICATOR
works with direnv, but this would need to be documented in snowcli
docs:
❯ cat .envrc
export SNOWFLAKE_ACCOUNT="<REDACTED>"
export SNOWFLAKE_USER="<REDACTED>"
export SNOWFLAKE_AUTHENTICATOR="externalbrowser"
❯ snow connection test --temporary-connection
+----------------------------------------------------+
| key | value |
|-----------------+----------------------------------|
| Connection name | None |
| Status | OK |
...
snow connection test
also works on my side, thank you.
I get this error if I just use environment variables without having declared any default
connection when using snow sql
commands. It would be great if we could only rely on environment variables without having to touch the config.toml
file.
$ echo "select 1" | snow sql --stdin
Couldn't find connection for default connection `default`. Specify connection name or configure default connection.
I just find out that we could also add a connection using snow connection add
and specify the named connection to use on a per-directory basis using the SNOWFLAKE_DEFAULT_CONNECTION_NAME
environment variable (which can be automatically set by direnv).
@SoheilSalmani Thanks for the report! We will update the documentation
Description
According to the documentation, we can configure some connection parameters (such as the account, user, etc.) using environment variables, but I can't find an equivalent environment variable for configuring the authenticator. I would like to be able to set it (e.g., export
SNOWFLAKE_AUTHENTICATOR=externalbrowser
) when using SSO.Another approach I'd like to take is specifying connection parameters in a named connection and then setting the connection to be used with something like
export SNOWFLAKE_CONNECTION=<connection_name>
.Context
I am using direnv to set my environment variables based on the current directory I am in. I would like to simply type
snow sql
to execute SQL using the correct context without needing to set any options. However, I can't do this when SSO is required.