Overview
This guide walks you through connecting your Snowflake data warehouse to Permutive so you can import data for audience building and activation. You’ll configure your Snowflake instance with the necessary permissions using a setup script, then create the connection in the Permutive dashboard.Prerequisites:
- A Snowflake account with
SECURITYADMINandACCOUNTADMINroles - Access to run SQL scripts in your Snowflake instance
- Knowledge of the database, schema, and warehouse you want to connect
Step 1: Set Up Your Snowflake Instance
To connect Permutive to your Snowflake instance, you’ll run a script that creates a dedicated user and role with read-only permissions. Choose between password authentication or key pair authentication.- Password Authentication
- Key Pair Authentication
Password authentication is the most straightforward method.This script will:
Run the Setup Script
Before running the script, replace the following placeholders:<PASSWORD>: The password for PERMUTIVE_USER<WAREHOUSE_NAME>: The warehouse Permutive will use to query data<DATABASE_NAME>: The database you want to import<SCHEMA_NAME>: The schema containing the tables you want to import
- Create a new role:
PERMUTIVE_ROLE - Create a new user:
PERMUTIVE_USER - Grant read access to the specified database and schema
- Grant read access to all current and future tables within the schema
Step 2: Configure Network Policy (Optional)
Skip this section if you’re not using Network Policies to control traffic to your Snowflake instance.
Create a User-Based Network Policy
We recommend creating a Network Policy attached to the Permutive user:Step 3: Create the Connection in Permutive
Select Snowflake from the Catalog
In the Permutive dashboard, go to Connectivity > Catalog and select Snowflake.
Enter Connection Details
Fill in the following fields:
| Field | Description |
|---|---|
| Database | The database name from your setup script (use UPPERCASE) |
| Host | Your Snowflake account URL. Find this under Admin > Accounts > View Account Details and copy the “Account/Server URL” (without https:// prefix) |
| Port | Leave as default 443 |
| User | The user created by the script (PERMUTIVE_USER) |
| Role | The role created by the script (PERMUTIVE_ROLE or PERMUTIVE_READ_ROLE) |
| Password | The password from your script (for password authentication only) |
| Warehouse | The Snowflake compute warehouse to use |
Step 4: Create an Import
Once your connection is active, you can create imports. Permutive uses incremental updates based on a cursor column to sync data efficiently.Cursor Column Requirements
When creating an import, you’ll need to select a cursor column. This column should be:- Monotonically increasing over time
- Not updated after creation
- Preferably unique or high-cardinality
- Not nullable
CREATED_ATorUPDATED_ATtimestamp columns
TIMESTAMP_TZ,TIMESTAMP_NTZ,TIME,DATE
For more details on configuring imports, see Imports.
Supported Data Types
Permutive supports the following Snowflake data types:| Category | Supported Types |
|---|---|
| Numeric | NUMBER, INTEGER, FLOAT, DOUBLE |
| String | VARCHAR, TEXT, STRING |
| Date/Time | DATE, TIME, TIMESTAMP_NTZ, TIMESTAMP_TZ, TIMESTAMP_LTZ |
| Logical | BOOLEAN |
Handling Semi-Structured Data
If your source tables containOBJECT or ARRAY columns, create a View that flattens the data:
Security Best Practices
- Use a dedicated read-only role and user per environment
- Limit grants to only the schemas you need
- Consider multi-factor policies for administrative users
Granting Access to Multiple Schemas
To grant access to additional schemas, repeat the following for each schema:Troubleshooting
Invalid credentials or host
Invalid credentials or host
If you receive authentication errors:
- Verify the account locator/region in your host URL
- Double-check the username and password
- Ensure you’re using UPPERCASE for database, schema, user, and role names
Permission denied
Permission denied
If you receive permission errors:
- Confirm
USAGEgrants on the warehouse, database, and schema - Verify
SELECTgrants on tables/views (including future tables)
Cursor validation errors
Cursor validation errors
If you receive cursor-related errors:
- Ensure the cursor column exists in the table
- Verify it’s one of the supported data types
- Avoid using nullable columns as cursors
Missing or duplicated rows
Missing or duplicated rows
If rows are missing or being re-synced:
- This can occur if multiple rows share the same cursor value
Network blocked
Network blocked
If connections are being blocked:
- Ensure Permutive’s IP addresses are allowlisted in your Network Policy
Key pair fingerprints don't match
Key pair fingerprints don't match
If the public key fingerprints don’t match:Solution: Reassign the public key to the user:
FAQ
Which Snowflake editions are supported?
Which Snowflake editions are supported?
All standard Snowflake editions are supported.
Can I sync views?
Can I sync views?
Yes, with
USAGE on the schema and SELECT on the view.What if my table doesn't have a suitable cursor column?
What if my table doesn't have a suitable cursor column?
If a table lacks a monotonically increasing column like a timestamp, it may not be suitable for incremental sync. You would need to add one to the table schema before importing.