Snowflake
To add a Snowflake connection, click on the Snowflake option in Connect a data source section.
Connect
Fill in the connection settings:
Display name
The display name for the database in the Wren AI interface.
Account
The account name for the account that you want to use to connect to your Snowflake database. The format is organization_name-account_name
.
You could find the account name from the Snowflake dashboard.
Database name
The name of the database you want to connect to.
Schema
The schema name for the schema that you want to use to connect to your Snowflake database.
Warehouse
Specifies the virtual warehouse for query execution. If blank, the account's default warehouse is used (if configured).
User
The database username for the account that you want to use to connect to your Snowflake database.
Authentication method
Username and password authentication will be deprecated by November 2025. We recommend switching to key pair authentication. Learn more
Choose between two authentication methods:
Password authentication
- Username: The database username for the account that you want to use to connect to your Snowflake database.
- Password: The password for the username that you use to connect to the database.
Key pair authentication
- Username: The database username for the account that you want to use to connect to your Snowflake database.
- Private key: Upload your unencrypted RSA private key file.
To configure key pair authentication, follow the Snowflake documentation to generate and configure your key pair. Make sure to use an unencrypted private key file for the connection.
Click Next to start connection and go to the next step.
Troubleshooting
Encrypted Private Key Error
If you encounter the following error:
Data connection error
251008: Failed to load private key: Password was not given but private key is encrypted Please provide a valid unencrypted rsa private key in DER format as bytes object
This means your private key is encrypted and needs to be decrypted. Follow these steps to create an unencrypted version:
-
Run the decryption command (it will prompt for your password):
openssl pkcs8 -inform PEM -in rsa_key.p8 -out rsa_key_unencrypted.p8
-
When prompted with
Enter PEM pass phrase:
, enter the password you set when generating the encrypted key. -
The output file will contain the unencrypted version:
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC...
-----END PRIVATE KEY----- -
Use this unencrypted private key file in the connection form.
Select Tables
All tables of your connected Snowflake dataset will be listed in this step. Select which tables you want to use in Wren AI. Each selected table will be created as a data model. See the Modeling documentations to learn more about what is data models.
Define relationships
Define the relationships among selected tables in this step. If you have defined primary keys and foreign keys in your Snowflake dataset, we will list suggested relationships based on the information. If not, you can also add relationships by clicking the Add relationships button on the table blocks.
Define following properties in a relationship:
- From: Select the left side table and column of this relationship.
- To: Select the right side table and column of this relationship.
- Relationship Type: Select the type of relationship.
Find more information about relationship in Modeling - Working with Relationships
You can also skip this step and finish connection.