Using Named Connections
To make multiple simultaneous connections to Snowflake, or to simply store different sets of connection configurations, you can define one or more named connections.
Defining Named Connections in the Configuration File
Open the
config
configuration file in a text editor. By default, the file is located in:- Linux/macOS
~/.snowsql/
- Windows
%USERPROFILE%\.snowsql\
Add a separate
[connections]
section with a unique name for each named connection.For example, the following illustrates a connection named
my_example_connection
for a Snowflake account with the account identifiermyorganization-myaccount
:[connections.my_example_connection] accountname = myorganization-myaccount username = jsmith password = xxxxxxxxxxxxxxxxxxxx dbname = mydb schemaname = public warehousename = mywh
Connecting to Snowflake Using a Named Connection
Use the -c <string>
(or --connection <string>
) connection parameter to specify a named connection, where <string>
is the name of a connection defined in the configuration file.
For example, connect using the my_example_connection
connection you created in Defining Named Connections in the Configuration File (in this topic):
$ snowsql -c my_example_connection
No comments:
Post a Comment