> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superblocks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Snowflake Warehouse

export const IntegrationSuccess = ({integrationName}) => {
  return <p>
      <b>{integrationName} connected!</b><br />You can now use{" "}
      <a href="/building-with-clark">Clark to build</a> with {integrationName}.
    </p>;
};

export const Alert = ({type, title, children}) => {
  const getIcon = () => {
    switch (type) {
      case 'info':
        return "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0zm0 15c-.552 0-1-.448-1-1s.448-1 1-1 1 .448 1 1-.448 1-1 1zm1-3H9V6h2v6z' fill='%230099FF'/%3E%3C/svg%3E";
      case 'success':
        return "data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0zm4.293 6.293L9 11.586 5.707 8.293c-.391-.391-1.024-.391-1.414 0s-.391 1.024 0 1.414l4 4c.391.391 1.024.391 1.414 0l6-6c.391-.391.391-1.024 0-1.414s-1.024-.391-1.414 0z' fill='%230CC26D'/%3E%3C/svg%3E";
      case 'warning':
        return "data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbDpzcGFjZT0ncHJlc2VydmUnIHdpZHRoPScxMDgwJyBoZWlnaHQ9JzEwODAnPjxyZWN0IHdpZHRoPScxMDAlJyBoZWlnaHQ9JzEwMCUnIGZpbGw9J3RyYW5zcGFyZW50Jy8+PHBhdGggZD0nTTEzLjc5NCAxMC43NSA4LjMgMS4yNWExLjUgMS41IDAgMCAwLTIuNiAwbC01LjQ5NCA5LjVBMS40OTQgMS40OTQgMCAwIDAgMS41IDEzaDExYTEuNDkzIDEuNDkzIDAgMCAwIDEuMjk0LTIuMjVNNi41IDUuNWEuNS41IDAgMCAxIDEgMFY4YS41LjUgMCAwIDEtMSAwek03IDExYS43NS43NSAwIDEgMSAwLTEuNS43NS43NSAwIDAgMSAwIDEuNScgc3R5bGU9J3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1kYXNoYXJyYXk6bm9uZTtzdHJva2UtbGluZWNhcDpidXR0O3N0cm9rZS1kYXNob2Zmc2V0OjA7c3Ryb2tlLWxpbmVqb2luOm1pdGVyO3N0cm9rZS1taXRlcmxpbWl0OjQ7ZmlsbDojZmY5ZjM1O2ZpbGwtcnVsZTpub256ZXJvO29wYWNpdHk6MScgdHJhbnNmb3JtPSd0cmFuc2xhdGUoLjAyIDE5LjMwNSlzY2FsZSg3Ny4xNCknLz48L3N2Zz4=";
      case 'danger':
        return "data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0zm5.707 4.293L10 9.586 4.293 4.293c-.391-.391-1.024-.391-1.414 0s-.391 1.024 0 1.414L8.586 11l-5.707 5.293c-.391.391-.391 1.024 0 1.414s1.024.391 1.414 0L10 12.414l5.707 5.293c.391.391 1.024.391 1.414 0s.391-1.024 0-1.414L11.414 11l5.707-5.293c.391-.391.391-1.024 0-1.414s-1.024-.391-1.414 0z' fill='%23F45252'/%3E%3C/svg%3E";
      case 'note':
        return "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0zm0 15c-.552 0-1-.448-1-1s.448-1 1-1 1 .448 1 1-.448 1-1 1zm1-3H9V6h2v6z' fill='%230099FF'/%3E%3C/svg%3E";
      default:
        return "";
    }
  };
  return <div className={`alert alert--${type}`}>
      <div className="alert-icon" style={{
    backgroundImage: `url("${getIcon()}")`,
    backgroundRepeat: 'no-repeat',
    backgroundPosition: 'center center',
    backgroundSize: '20px',
    width: '24px',
    height: '24px',
    position: 'absolute',
    left: '16px',
    top: '16px'
  }} />
      <div className="alert-content">
        {title && <div className="alert-title">{title}</div>}
        <div className="alert-body">{children}</div>
      </div>
    </div>;
};

Snowflake is a cloud-based data platform that combines the power of a data warehouse with the flexibility of a cloud solution, enabling organizations to store, analyze, and share large volumes of data seamlessly. Using the Superblocks integration with Snowflake, teams can effortlessly build custom internal tools that leverage real-time data, streamlining workflows and enhancing operational efficiency across the organization.

## Setting up Snowflake

<Alert type="info">
  <p>
    If you're using Superblocks Cloud, you may need to allowlist Superblocks IP addresses to connect to your database.
    Learn how to configure this in Snowflake's guide on{" "}
    <a href="https://docs.snowflake.com/en/user-guide/network-policies">Controlling network traffic with network policies</a>.
    Alternatively, use Superblocks Hybrid or Cloud-Prem architectures to keep your data within your VPC.
  </p>
</Alert>

### 1. Add integration

<p>
  Select <strong>Snowflake Warehouse</strong> from the{" "}
  <a href="https://app.superblocks.com/integrations/snowflake">integrations page</a>.
</p>

### 2. Configure settings

Fill out the form with the following settings based on your authentication method:

<Tabs>
  <Tab title="Password-based authentication">
    | Field              | Required                                   | Description                                                                                                                                                                                                 |
    | ------------------ | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Account identifier | <span className="table-checkmark">✓</span> | Snowflake [account identifier](https://docs.snowflake.com/en/user-guide/admin-account-identifier.html#account-identifiers). The account identifier **does not** include the `snowflakecomputing.com` suffix |
    | Username           | <span className="table-checkmark">✓</span> | Login name for the user                                                                                                                                                                                     |
    | Password           | <span className="table-checkmark">✓</span> | Password for the user                                                                                                                                                                                       |
    | Database           | <span className="table-checkmark">✓</span> | Name of the database to use                                                                                                                                                                                 |
    | Default warehouse  | <span className="table-x">✗</span>         | Name of the warehouse to use. Defaults to the user's default warehouse                                                                                                                                      |
    | Default schema     | <span className="table-x">✗</span>         | Name of the schema to use for the database. Defaults to **public**                                                                                                                                          |
    | Default role       | <span className="table-x">✗</span>         | Name of the role to use. Defaults to the user's default role                                                                                                                                                |
  </Tab>

  <Tab title="Native SSO">
    | Field              | Required                                   | Description                                                                                                                                                                                                 |
    | ------------------ | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Account identifier | <span className="table-checkmark">✓</span> | Snowflake [account identifier](https://docs.snowflake.com/en/user-guide/admin-account-identifier.html#account-identifiers). The account identifier **does not** include the `snowflakecomputing.com` suffix |
    | Username           | <span className="table-checkmark">✓</span> | User name of Okta user                                                                                                                                                                                      |
    | Password           | <span className="table-checkmark">✓</span> | Password of Okta user                                                                                                                                                                                       |
    | Authenticator URL  | <span className="table-checkmark">✓</span> | The URL endpoint for your Okta account (e.g. `https://<okta_account_name>.okta.com`)                                                                                                                        |
    | Database           | <span className="table-checkmark">✓</span> | Name of the database to use                                                                                                                                                                                 |
    | Default warehouse  | <span className="table-x">✗</span>         | Name of the warehouse to use. Defaults to the user's default warehouse                                                                                                                                      |
    | Default schema     | <span className="table-x">✗</span>         | Name of the schema to use for the database. Defaults to **public**                                                                                                                                          |
    | Default role       | <span className="table-x">✗</span>         | Name of the role to use. Defaults to the user's default role                                                                                                                                                |

    For more information, see Snowflake's docs on [Native SSO](https://docs.snowflake.com/en/user-guide/admin-security-fed-auth-use#native-sso-okta-only)
  </Tab>

  <Tab title="Key-pair authentication">
    | Field              | Required                                   | Description                                                                                                                                                                                                                                                          |
    | ------------------ | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Account identifier | <span className="table-checkmark">✓</span> | Snowflake [account identifier](https://docs.snowflake.com/en/user-guide/admin-account-identifier.html#account-identifiers). The account identifier **does not** include the `snowflakecomputing.com` suffix                                                          |
    | Username           | <span className="table-checkmark">✓</span> | Login name for the user                                                                                                                                                                                                                                              |
    | Private key        | <span className="table-checkmark">✓</span> | The private key used for authentication. For more information, see [Using key-pair authentication and key-pair rotation](https://docs.snowflake.com/en/developer-guide/python-connector/python-connector-connect.html#label-python-key-pair-authn-rotation).         |
    | Passphrase         | <span className="table-x">✗</span>         | The passphrase used to decrypt the private key for the specified user. See [Using key-pair authentication and key-pair rotation](https://docs.snowflake.com/en/developer-guide/python-connector/python-connector-connect.html#label-python-key-pair-authn-rotation). |
    | Database           | <span className="table-checkmark">✓</span> | Name of the database to use                                                                                                                                                                                                                                          |
    | Default warehouse  | <span className="table-x">✗</span>         | Name of the warehouse to use. Defaults to the user's default warehouse                                                                                                                                                                                               |
    | Default schema     | <span className="table-x">✗</span>         | Name of the schema to use for the database. Defaults to **public**                                                                                                                                                                                                   |
    | Default role       | <span className="table-x">✗</span>         | Name of the role to use. Defaults to the user's default role                                                                                                                                                                                                         |

    For more information, see Snowflake's docs on [Key-pair authentication](https://docs.snowflake.com/en/user-guide/key-pair-auth)
  </Tab>

  <Tab title="External OAuth">
    | Field                | Required                                   | Description                                                                                                                                                                                                 |
    | -------------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Account identifier   | <span className="table-checkmark">✓</span> | Snowflake [account identifier](https://docs.snowflake.com/en/user-guide/admin-account-identifier.html#account-identifiers). The account identifier **does not** include the `snowflakecomputing.com` suffix |
    | Subject token source | <span className="table-checkmark">✓</span> |                                                                                                                                                                                                             |
    | Token URL            | <span className="table-checkmark">✓</span> | The token endpoint of the authorization server, used to exchange an authorization code for an access token                                                                                                  |
    | Client ID            | <span className="table-checkmark">✓</span> | The ID issues to your OAuth client during registration                                                                                                                                                      |
    | Client secret        | <span className="table-checkmark">✓</span> | The secret issued to your OAuth client during registration                                                                                                                                                  |
    | Audience             | <span className="table-checkmark">✓</span> | Snowflake [account url](https://docs.snowflake.com/en/user-guide/admin-account-identifier#finding-the-organization-and-account-name-for-an-account)                                                         |
    | Scopes               | <span className="table-checkmark">✓</span> | `session:role-any`                                                                                                                                                                                          |
    | Database             | <span className="table-checkmark">✓</span> | Name of the database to use                                                                                                                                                                                 |
    | Default warehouse    | <span className="table-x">✗</span>         | Name of the warehouse to use. Defaults to the user's default warehouse                                                                                                                                      |
    | Default schema       | <span className="table-x">✗</span>         | Name of the schema to use for the database. Defaults to **public**                                                                                                                                          |
    | Default role         | <span className="table-x">✗</span>         | Name of the role to use. Defaults to the user's default role                                                                                                                                                |

    For more information:

    * See Snowflake's docs on [External Auth](https://docs.snowflake.com/en/user-guide/oauth-ext-overview)
    * Check out our tutorial on [Snowflake External OAuth with Okta as your IdP](/integrations/auth/guides/snowflake-external-oauth-with-okta)
  </Tab>
</Tabs>

### 3. Test and save

Click **Test Connection** to check that Superblocks can connect to the data source.

After connecting successfully, click **Create** to save the integration.

### 4. Set data tags

Optionally, configure different data tags for [separate development environments](/development-lifecycle/build/data-tags).

<Alert type="success">
  <IntegrationSuccess integrationName="Snowflake" />
</Alert>

## Troubleshooting

If you run into issues, see [Troubleshooting Database Integrations](/integrations/troubleshooting/troubleshooting-databases).
