Prerequisites

To connect Snowflake to Push.ai, you need the following:

  • A Snowflake account with the appropriate permissions to create a user.

Setup Guide

Step 1 - Create the warehouse connection

  1. Log in to your Snowflake data warehouse.

  2. Copy the following script to a new worksheet and select the All Queries checkbox:

-- Edit the following variables
set push_username='PUSH_AI_USER';
set push_password='<a secure password>';
set push_first_name='Push.ai';
set push_last_name='User';
set push_default_warehouse='<warehouse>';
set push_database='<database>';
set push_default_namespace='<database.schema>';
set push_default_role='PUSH_AI_ROLE';
set push_comment='Used for Push.ai integrations';

-- Set role for grants
USE ROLE ACCOUNTADMIN;

-- Create a role for PUSH_AI
CREATE ROLE IF NOT EXISTS identifier($push_default_role)
COMMENT = $push_comment;

-- Create PUSH_AI's user
CREATE USER IF NOT EXISTS identifier($push_username)
PASSWORD=$push_password
FIRST_NAME=$push_first_name
LAST_NAME=$push_last_name
DEFAULT_WAREHOUSE=$push_default_warehouse
DEFAULT_NAMESPACE=$push_default_namespace
DEFAULT_ROLE=$push_default_role
COMMENT=$push_comment;


-- Grant permissions to the role
GRANT ROLE identifier($push_default_role) TO ROLE SYSADMIN;
GRANT USAGE ON WAREHOUSE identifier($push_default_warehouse) TO ROLE identifier($push_default_role);
GRANT ROLE identifier($push_default_role) TO USER identifier($push_username);

GRANT USAGE ON DATABASE identifier($push_database) TO ROLE identifier($push_default_role);
GRANT USAGE ON ALL SCHEMAS IN DATABASE identifier($push_database) TO ROLE identifier($push_default_role);
GRANT SELECT ON ALL TABLES IN DATABASE identifier($push_database) TO ROLE identifier($push_default_role);
GRANT SELECT ON FUTURE TABLES IN DATABASE identifier($push_database) TO ROLE identifier($push_default_role);
GRANT SELECT ON ALL VIEWS IN DATABASE identifier($push_database) TO ROLE identifier($push_default_role);
GRANT SELECT ON FUTURE VIEWS IN DATABASE identifier($push_database) TO ROLE identifier($push_default_role);

-- Grant write access for Push.ai specific schema (required for additional write-related features)
GRANT CREATE SCHEMA ON DATABASE identifier($push_database) TO ROLE identifier($push_default_role);
  1. Replace the password, warehouse and database variables with appropriate values.

  2. Run the script.

Step 2 - Whitelist IP Addresses (if necessary)

Push.ai connects to your warehouse from the following IP addresses. Be sure to allow traffic from these IPs in your firewall, and include them in any database grants.

Region/DeploymentIP Addresses
All44.226.145.213, 54.187.200.255, 34.213.214.55, 35.164.95.156, 44.230.95.183, 44.229.200.200

Step 3 - Configure the connection in Push.ai

  1. Enter your Snowflake Account Identifier. You can find this identifier at the beginning of your Snowflake URL, for example, https://ACCOUNT_IDENTIFIER.snowflakecomputing.com.

Account identifier format may differ based on Snowflake account age.

For example, older Snowflake accounts often have identifiers that look like <account_locator>.<region>.<cloudprovider>, whereas newer Snowflake accounts have identifiers that look like <orgname>-<account_name>.

For more details, visit Snowflake’s account identifier docs.

  1. For Role, Database, Warehouse, Username, and Password enter the values used when running the script.

  2. Test and create the datasource connection.