Sunday, March 27, 2022

Snowfalek connection Using Named Connections

 

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

  1. Open the config configuration file in a text editor. By default, the file is located in:

    Linux/macOS

    ~/.snowsql/

    Windows

    %USERPROFILE%\.snowsql\

  2. 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 identifier myorganization-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

Recent Post

Databricks Delta table merge Example

here's some sample code that demonstrates a merge operation on a Delta table using PySpark:   from pyspark.sql import SparkSession # cre...