snow connection add¶
Adds a connection to configuration file.
Syntax¶
Arguments¶
None
Options¶
--connection-name, -n TEXTName of the new connection.
-a, --account, --accountname TEXTAccount name to use when authenticating with Snowflake. Specify the account identifier, for example
myorganization-myaccount.-u, --user, --username TEXTUsername to connect to Snowflake.
-p, --password TEXTSnowflake password.
-r, --role, --rolename TEXTRole to use on Snowflake.
-w, --warehouse TEXTWarehouse to use on Snowflake.
-d, --database, --dbname TEXTDatabase to use on Snowflake.
-s, --schema, --schemaname TEXTSchema to use on Snowflake.
-h, --host TEXTHost name the connection attempts to connect to Snowflake. If you don’t specify a host, the connector builds it from the account identifier, for example
myorganization-myaccount.snowflakecomputing.com.-P, --port INTEGERPort to communicate with on the host.
--protocol TEXTProtocol to use for the connection, for example
https.--region, -R TEXTRegion name if not the default Snowflake deployment.
-A, --authenticator TEXTChosen authenticator, if other than password-based. For the supported values, see the authenticator parameter in Python Connector API.
-W, --workload-identity-provider TEXTWorkload identity provider type.
--private-key, -k, --private-key-file, --private-key-path TEXTPath to file containing private key.
-t, --token-file-path TEXTPath to file with an OAuth token that should be used when connecting to Snowflake.
--secondary-roles TEXTSecondary roles mode applied when the session starts. Supported values are
ALLandNONE; passNONEto run the session only with the primary role.--server-session-keep-aliveEnable server-side session keep-alive to prevent the session from timing out during long operations.
--client-store-temporary-credentialStore the temporary credential.
--defaultIf provided the connection will be configured as default connection. Default: False.
--no-interactiveDisable prompting. Default: False.
--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¶
The snow connection add command adds the connection to your default config.toml file. For more information, see Configuring Snowflake CLI and connecting to Snowflake.
Examples¶
-
To add a connection, run the following:
The following example shows the format of typical values, passed on the command line instead of at the prompts. The
--accountvalue is your account identifier in the<orgname>-<account_name>format. You typically don’t need--host; if you do specify it, use the full host name, such asmyorganization-myaccount.snowflakecomputing.com.With the default configuration, snow connection add saves the connection in connections.toml if that file exists; otherwise it saves it in config.toml. The command reports the destination path.