|
Python Connector for Snowflake Connecting to Snowflake - Python Connector for Snowflake |
|
To establish a connection to a Snowflake database, import the connector and use the connect() method with your connection parameters.
First, import the Snowflake connector module:
my_connection = snowflake.connect(
Domain="your_instance;",
UserId="your_username",
Password="your_password",Database="your_database;"
)
Call the connect() method and obtain a connection object.
response = snowflake.signin()
my_connection = snowflake.connect(
CompanyId=response["Company Id"],
RefreshToken=response["Refresh Token"]
)
Replace the example values with your actual connection values.
For more information, see Connection parameters.