# Snowflake

{% hint style="warning" %}
**IP RESTRICTIONS**

Make sure to allow traffic from one of the Paradime IPs in your firewall depending on the data location selected.

👉 See also: [Paradime IP addresses](https://docs.paradime.io/app-help/developers/ip-restrictions).
{% endhint %}

## Suggested permissions

This set of permissions will enable users in Paradime to read from and create tables and views when running dbt™️ from the Paradime terminal in you Snowflake database.&#x20;

The role connected in Paradime for should have the below permissions for each database where your source data lives and where you want to materialize your models. Make sure to

<pre class="language-sql" data-line-numbers><code class="lang-sql">-- grant permission to allow role to read from your source database
grant usage on database &#x3C;your_databse_name> to role &#x3C;snowflake_role>;
grant usage on future schemas in database &#x3C;your_databse_name> to role &#x3C;snowflake_role>;
grant select on future tables in database &#x3C;your_databse_name> to role &#x3C;snowflake_role>;
grant select on future views in database &#x3C;your_databse_name> to role &#x3C;snowflake_role>;
grant usage on all schemas in database &#x3C;your_databse_name> to role &#x3C;snowflake_role>;
<strong>grant select on all tables in database &#x3C;your_databse_name> to role &#x3C;snowflake_role>;
</strong>grant select on all views in database &#x3C;your_databse_name> to role &#x3C;snowflake_role>;

-- grant permission to allow role to write to your dev database
grant all on database &#x3C;your_databse_name> to role &#x3C;snowflake_role>;
</code></pre>

## Add Development Connection

You will be prompted to add a Development connection during the onboarding, or you can add more connections by going executing the following instructions:

1. Click **Settings** in the top menu bar of the Paradime interface to access **Account Settings**
2. In the left sidebar, click "**Connections**"
3. Click "**Add New**" next to the Code IDE section
4. Select "Snowflake"

## Using Username & Password

<figure><img src="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FKblS6XdfUoFdPuWy0DIE%2Fdev_connection_snowflake_u%26p.png?alt=media&#x26;token=1bf4a18a-75d1-4e77-bfcc-beb5d7e54ba4" alt="" width="540"><figcaption></figcaption></figure>

### Field Details

Below are list of fields and example to create a connection.

{% hint style="info" %}

* 🏢 **`Workspace level`** fields are set by the the workspace `Admin` and not configurable for by user
* 👥 **`User level`** fields are set by each user (`Admin`/`Developer`) when setting the Development connection.
  {% endhint %}

<table><thead><tr><th width="180.33333333333331">Field</th><th width="254">Description</th><th>Example</th><th>Level<select><option value="e1546276913f4276bb60769e2fa018cc" label="🏢 Workspace level" color="blue"></option><option value="81b26ab5639143d8b5402f5c958521fe" label="👥 User level" color="blue"></option></select></th></tr></thead><tbody><tr><td>Profile Name</td><td>The profile name set in your <code>dbt_project.yaml</code> . See more <a href="https://docs.getdbt.com/docs/core/connect-data-platform/connection-profiles">here</a>.</td><td><strong><code>dbt-snowflake</code></strong></td><td><span data-option="e1546276913f4276bb60769e2fa018cc">🏢 Workspace level</span></td></tr><tr><td>Target</td><td>The target name used to identify the connection. See more <a href="https://docs.getdbt.com/reference/dbt-jinja-functions/target">here</a>.</td><td><strong><code>dev</code></strong></td><td><span data-option="e1546276913f4276bb60769e2fa018cc">🏢 Workspace level</span></td></tr><tr><td>Account</td><td>The Snowflake account to connect to as per <a href="https://docs.snowflake.com/en/user-guide/admin-account-identifier">Snowflake's documentation.</a></td><td><strong><code>vj71689.eu-west-2.aws</code></strong></td><td><span data-option="e1546276913f4276bb60769e2fa018cc">🏢 Workspace level</span></td></tr><tr><td>Role</td><td>The role to assume when running queries as the specified user.</td><td><strong><code>transformer</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr><tr><td>Database</td><td>The name of your Snowflake development database.</td><td><strong><code>analytics</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr><tr><td>Warehouse</td><td>The virtual warehouse to use for running queries.</td><td><strong><code>transforming</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr><tr><td>Username</td><td>The username of the user.</td><td><strong><code>john_user</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr><tr><td>Password</td><td>The password set for the user</td><td><strong><code>password_xyz</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr><tr><td>Dataset</td><td>The default dataset used to build dbt™️ objects at runtime.</td><td><strong><code>dbt_john</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr><tr><td>Threads</td><td>The number of threads used in this connection. See more <a href="https://docs.getdbt.com/docs/running-a-dbt-project/using-threads">here</a>.</td><td><strong><code>8</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr></tbody></table>

## Using Snowflake OAuth

Check our Tutorial on how to setup Snowflake OAuth in your Snowflake account. Once this connection is configured, each user will be redirected to Snowflake and asked to authenticate their connection.

{% content-ref url="../connection-security/snowflake-oauth" %}
[snowflake-oauth](https://docs.paradime.io/app-help/documentation/settings/connections/connection-security/snowflake-oauth)
{% endcontent-ref %}

<figure><img src="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FI4MW0rfOYvzONjzgOhXt%2Fdev_connection_snowflake_oauth.png?alt=media&#x26;token=b04d68f6-d3b7-4f21-aae8-821df1211548" alt="" width="540"><figcaption></figcaption></figure>

### Fields Details

Below are list of fields and example to create a connection.

{% hint style="info" %}

* 🏢 **`Workspace level`** fields are set by the the workspace `Admin` and not configurable for by user
* 👥 **`User level`** fields are set by each user (`Admin`/`Developer`) when setting the Development connection.
  {% endhint %}

<table><thead><tr><th width="187.33333333333331">Field</th><th width="254">Description</th><th>Example</th><th>Level<select><option value="e1546276913f4276bb60769e2fa018cc" label="🏢 Workspace level" color="blue"></option><option value="81b26ab5639143d8b5402f5c958521fe" label="👥 User level" color="blue"></option></select></th></tr></thead><tbody><tr><td>Profile Name</td><td>The profile name set in your <code>dbt_project.yaml</code> . See more <a href="https://docs.getdbt.com/docs/core/connect-data-platform/connection-profiles">here</a>.</td><td><strong><code>dbt-snowflake</code></strong></td><td><span data-option="e1546276913f4276bb60769e2fa018cc">🏢 Workspace level</span></td></tr><tr><td>Target</td><td>The target name used to identify the connection. See more <a href="https://docs.getdbt.com/reference/dbt-jinja-functions/target">here</a>.</td><td><strong><code>dev</code></strong></td><td><span data-option="e1546276913f4276bb60769e2fa018cc">🏢 Workspace level</span></td></tr><tr><td>Account</td><td>The Snowflake account to connect to as per <a href="https://docs.snowflake.com/en/user-guide/admin-account-identifier">Snowflake's documentation.</a></td><td><strong><code>vj71689.eu-west-2.aws</code></strong></td><td><span data-option="e1546276913f4276bb60769e2fa018cc">🏢 Workspace level</span></td></tr><tr><td>Client ID</td><td>The Client ID generated when setting up the OAuth credentials.</td><td><strong><code>UPWBLFUTwT7hJ+JDbNthut3rF3w=</code></strong></td><td><span data-option="e1546276913f4276bb60769e2fa018cc">🏢 Workspace level</span></td></tr><tr><td>Client Secret</td><td>The Client Secret generated when setting up the OAuth credentials.</td><td><strong><code>7FMKYoOP9+KUh2qqVHXfsZStUJLpiaa/ojFmvGwr06E=</code></strong></td><td><span data-option="e1546276913f4276bb60769e2fa018cc">🏢 Workspace level</span></td></tr><tr><td>Role</td><td>The role to assume when running queries as the specified user.</td><td><strong><code>transformer</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr><tr><td>Database</td><td>The name of your Snowflake development database.</td><td><strong><code>analytics</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr><tr><td>Warehouse</td><td>The virtual warehouse to use for running queries.</td><td><strong><code>transforming</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr><tr><td>Dataset</td><td>The default dataset used to build dbt™️ objects at runtime.</td><td><strong><code>dbt_john</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr><tr><td>Threads</td><td>The number of threads used in this connection. See more <a href="https://docs.getdbt.com/docs/running-a-dbt-project/using-threads">here</a>.</td><td><strong><code>8</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr></tbody></table>

## Using Key-Pair authentication

In Paradime you can use Key-Pair authentication method to enabled users to connect their development environment using a Private Key and optionally a Private Key Passphrase.

After [generating an encrypted or unencrypted key pair](https://docs.snowflake.com/en/user-guide/key-pair-auth#configuring-key-pair-authentication),, you will need to set the `rsa_public_key` for the Snowflake user connecting to Paradime.

```sql
alter user johnsmith set rsa_public_key='MIIBIjANBgkqh...';
```

<figure><img src="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FziNdkByNWwbQiHq3754M%2Fdev_connection_snowflake_key_pair.png?alt=media&#x26;token=2cf15e45-7be4-4958-a700-581c5a927013" alt="" width="540"><figcaption></figcaption></figure>

### Fields Details

Below are list of fields and example to create a connection.

{% hint style="info" %}

* 🏢 **`Workspace level`** fields are set by the the workspace `Admin` and not configurable for by user
* 👥 **`User level`** fields are set by each user (`Admin`/`Developer`) when setting the Development connection.
  {% endhint %}

<table><thead><tr><th width="137.33333333333331">Field</th><th width="277">Description</th><th width="195">Example</th><th>Level<select><option value="e1546276913f4276bb60769e2fa018cc" label="🏢 Workspace level" color="blue"></option><option value="81b26ab5639143d8b5402f5c958521fe" label="👥 User level" color="blue"></option></select></th></tr></thead><tbody><tr><td>Profile Name</td><td>The profile name set in your <code>dbt_project.yaml</code> . See more <a href="https://docs.getdbt.com/docs/core/connect-data-platform/connection-profiles">here</a>.</td><td><strong><code>dbt-snowflake</code></strong></td><td><span data-option="e1546276913f4276bb60769e2fa018cc">🏢 Workspace level</span></td></tr><tr><td>Target</td><td>The target name used to identify the connection. See more <a href="https://docs.getdbt.com/reference/dbt-jinja-functions/target">here</a>.</td><td><strong><code>dev</code></strong></td><td><span data-option="e1546276913f4276bb60769e2fa018cc">🏢 Workspace level</span></td></tr><tr><td>Account</td><td>The Snowflake account to connect to as per <a href="https://docs.snowflake.com/en/user-guide/admin-account-identifier">Snowflake's documentation.</a></td><td><strong><code>vj71689.eu-west-2.aws</code></strong></td><td><span data-option="e1546276913f4276bb60769e2fa018cc">🏢 Workspace level</span></td></tr><tr><td>Role</td><td>The role to assume when running queries as the specified user.</td><td><strong><code>transformer</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr><tr><td>Database</td><td>The name of your Snowflake development database.</td><td><strong><code>analytics</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr><tr><td>Warehouse</td><td>The virtual warehouse to use for running queries.</td><td><strong><code>transforming</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr><tr><td>Username</td><td>The username of the user.</td><td><strong><code>john_user</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr><tr><td>Private Key</td><td>The Private Key generated and linked to the user. You <strong>must</strong> include the commented lines when adding the Private Key.</td><td><strong><code>-----BEGIN ENCRYPTED PRIVATE KEY----- &#x3C; private key content here > -----END ENCRYPTED PRIVATE KEY-----</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr><tr><td>Private Key Passphrase (Optional)</td><td>The Passphrase created when generating the encrypted key</td><td><strong><code>passphrase_xyz</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr><tr><td>Dataset</td><td>The default dataset used to build dbt™️ objects at runtime.</td><td><strong><code>dbt_john</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr><tr><td>Threads</td><td>The number of threads used in this connection. See more <a href="https://docs.getdbt.com/docs/running-a-dbt-project/using-threads">here</a>.</td><td><strong><code>8</code></strong></td><td><span data-option="81b26ab5639143d8b5402f5c958521fe">👥 User level</span></td></tr></tbody></table>
