Snowflake
Connecting to Snowflake
For an overview of the connector, please refer to the following link:
Create a Connector
Select the “Connectors” tab on the top page and click the “Create” button.
Enter Snowflake Credentials
Snowflake offers three authentication methods.
Please refer to the official page for the Snowflake Server URL.
Connecting with Private Key
Select Snowflake (Key Pair) and enter the required credentials in the displayed form.
Field Name | Description | Required | Example |
---|---|---|---|
Server | Standard Snowflake Account URL | ✅ | https://<account_locator>.<region>.<cloud>.snowflakecomputing.com |
Username | Username | ✅ | DEMO_USER |
Private Key | Private Key | ✅ | -----BEGIN PRIVATE KEY----- |
Passphrase | Private Key Passphrase | passphrase |
Please refer to the official page for creating a private key.
Connecting with User/Password
Select Snowflake (user / password) and enter the required credentials in the displayed form.
Field Name | Description | Required | Example |
---|---|---|---|
Server | Standard Snowflake Account URL | ✅ | https://<account_locator>.<region>.<cloud>.snowflakecomputing.com |
Username | Username | ✅ | DEMO_USER |
Password | Password | ✅ | password |
Connecting with OAuth
Select Snowflake (OAuth) and enter the required credentials in the displayed form.
Field Name | Description | Required | Example |
---|---|---|---|
Server | Standard Snowflake Account URL | ✅ | https://<account_locator>.<region>.<cloud>.snowflakecomputing.com |
Client Id | Client ID | ✅ | CLIENT_ID |
Client Secret | Client Secret | ✅ | CLIENT_SECRET |
Please refer to the official page for creating a Client ID and Client Secret.
After entering the information, click the Create button to complete the creation. If there are any errors, please check the connection details again.
Connect to the Created Database
Once successfully created, you can obtain the connector name from the list display. The string next to the icon is connection_name
. You can use this to connect to the database in your code.
Enter the created connector name in your SQL or Python code to retrieve data.
Create a Connector
Select the “Connectors” tab on the top page and click the “Create” button.
Enter Snowflake Credentials
Snowflake offers three authentication methods.
Please refer to the official page for the Snowflake Server URL.
Connecting with Private Key
Select Snowflake (Key Pair) and enter the required credentials in the displayed form.
Field Name | Description | Required | Example |
---|---|---|---|
Server | Standard Snowflake Account URL | ✅ | https://<account_locator>.<region>.<cloud>.snowflakecomputing.com |
Username | Username | ✅ | DEMO_USER |
Private Key | Private Key | ✅ | -----BEGIN PRIVATE KEY----- |
Passphrase | Private Key Passphrase | passphrase |
Please refer to the official page for creating a private key.
Connecting with User/Password
Select Snowflake (user / password) and enter the required credentials in the displayed form.
Field Name | Description | Required | Example |
---|---|---|---|
Server | Standard Snowflake Account URL | ✅ | https://<account_locator>.<region>.<cloud>.snowflakecomputing.com |
Username | Username | ✅ | DEMO_USER |
Password | Password | ✅ | password |
Connecting with OAuth
Select Snowflake (OAuth) and enter the required credentials in the displayed form.
Field Name | Description | Required | Example |
---|---|---|---|
Server | Standard Snowflake Account URL | ✅ | https://<account_locator>.<region>.<cloud>.snowflakecomputing.com |
Client Id | Client ID | ✅ | CLIENT_ID |
Client Secret | Client Secret | ✅ | CLIENT_SECRET |
Please refer to the official page for creating a Client ID and Client Secret.
After entering the information, click the Create button to complete the creation. If there are any errors, please check the connection details again.
Connect to the Created Database
Once successfully created, you can obtain the connector name from the list display. The string next to the icon is connection_name
. You can use this to connect to the database in your code.
Enter the created connector name in your SQL or Python code to retrieve data.
~/.morph/connections.yml
.Run the morph init Command
Run the morph init
command to save the DB connection information to ~/.morph/connections.yml
.
If the morph package is not installed, please install it with the following command before proceeding.
A list of database types will be displayed in the interactive interface, select Snowflake (User/Password).
Next, enter the credentials. slug
is treated as the connector name, which you specify in SQL or Python.
Replace the following input examples with actual values that can connect.
Once the credentials are saved, the following message will be displayed.
connections.yml
is saved as follows. If other connectors are created, they will be added under connections
.
Retrieve Data Using the Connector in Code
Enter the created connector name in your SQL or Python code to retrieve data.
When actually specifying the connector and executing the file, the priority is as follows.
Also, please note that only connectors created in the dashboard can be used in environments where morph deploy
has been performed.
- Connectors listed in
~/.morph/connections.yml
on the local machine - Connectors registered in the cloud
How to Write for Private Key and OAuth
When using a private key or OAuth, directly edit ~/.morph/connections.yml
.
Access token refresh is a dashboard feature, so the one listed will always be used in the local environment.
Private Key Method
OAuth Method