Drivetrain Integration Guide
  • INTEGRATION GUIDE
    • Integrate with Drivetrain
      • Accounting & ERP
        • Integrating with Certinia
        • Integrating with NetSuite
        • Integrating with QuickBooks
        • Integrating with Rillet
        • Integrating with Sage Intacct
        • Integrating with Tally
        • Integrating with Xero
        • Integrating with Zoho Books
      • BI
        • Integrating with Looker
        • Integrating with Tableau
      • Billing & Invoicing
        • Integrating with Chargebee
        • Integrating with Invoiced
        • Integrating with Maxio Chargify
        • Integrating with Maxio SaaSOptics
        • Integrating with Recurly
        • Integrating with Stripe
        • Integrating with Subscript
      • CRM
        • Integrating with Active Campaign
        • Integrating with HubSpot
        • Integrating with LeadSquared
        • Integrating with Outreach
        • Integrating with Pipedrive
        • Integrating with Salesforce
      • Customer Success
        • Integrating with ChurnZero
        • Integrating with Freshdesk
        • Integrating with Planhat
        • Integrating with Zendesk
      • Databases and Warehouses
        • Integrating with Azure SQL Server
        • Integrating with BigQuery
        • Integrating with Databricks
        • Integrating with Redshift
        • Integrating with S3
        • Integrating with Snowflake
        • Integrating with Snowflake (Small Datasets)
        • Integrating with Google Cloud Storage
        • Integrating with Postgres
      • HRIS & ATS
        • Integrating with ADP
        • Integrating with ADP Workforce Now (SFTP)
        • Integrating with Ashby
        • Integrating with BambooHR
        • Integrating with Darwinbox
        • Integrating with Deel
        • Integrating with Greenhouse
        • Integrating with Gusto
        • Integrating with HiBob
        • Integrating with Justworks
        • Integrating with Lever
        • Integrating with Namely
        • Integrating with Paylocity
        • Integrating with Personio
        • Integrating with Sapling
        • Integrating with UKG Pro
        • Integrating with Zenefits
      • Spreadsheets
        • Integrating with Airtable
        • Integrating with Google Drive
        • Integrating with Google Sheets
        • Integrating with Microsoft OneDrive
      • Others
        • Integrating with Brex
        • Integrating with Clari
        • Integrating with NetSuite (Role Based Access)
        • Integrating with Shopify
        • Integrating with Twilio
        • Integrating with Officevibe
        • Integrating with SFTP
        • Integrating with Drivetrain's SFTP
        • Setting up SSO
Powered by GitBook
On this page
  • Prerequisites
  • Snowflake Setup
  • Creating Storage Integration
  • Step 1: Create storage integration with provider as GCS
  • Connecting via username & password
  • Step 1: Create a new warehouse/use an existing warehouse
  • Step 2: Create a user & role
  • Step 3: Get Snowflake identifier details
  • Step 4: Add permissions to tables
  • Step 5: Provide access to warehouse
  • Connecting via key-pair
  • Step 1: Generate a private key
  • Step 2: Generate a public key
  • Step 3: Assign the public key to a Snowflake user
  • Drivetrain Setup
  • Step 1: Connect to Snowflake
  • Step 2: Import data from Snowflake

Was this helpful?

  1. INTEGRATION GUIDE
  2. Integrate with Drivetrain
  3. Databases and Warehouses

Integrating with Snowflake (Small Datasets)

PreviousIntegrating with SnowflakeNextIntegrating with Google Cloud Storage

Last updated 1 month ago

Was this helpful?

Prerequisites

To connect Snowflake to Drivetrain, you will need:

  • Admin privileges in Snowflake

  • Owners of a user, or users with the SECURITYADMIN role or higher in Snowflake to be able to alter a user (if connecting via key-pair) . For more information, see and .

  • Admin permissions in Drivetrain.

Snowflake Setup

Creating Storage Integration

Step 1: Create storage integration with provider as GCS

  1. Execute the below query command to create GCS integration.

CREATE STORAGE INTEGRATION gcs_int
TYPE = EXTERNAL_STAGE
STORAGE_PROVIDER = 'GCS'
ENABLED = TRUE
STORAGE_ALLOWED_LOCATIONS = ('gcs://dt-data-import/{Tenant_ID}/');

Note: Get Tenant_ID from your Customer Success Manager or Data Integrations Manage:

  1. Execute the below query to retrieve the Service Account details, get the property_value of "STORAGE_GCP_SERVICE_ACCOUNT" property and store it in a secured document.

// Some code
DESC STORAGE INTEGRATION gcs_int;

Connecting via username & password

Step 1: Create a new warehouse/use an existing warehouse

  1. Go to Admin → Warehouses in the left navigation section.

  1. We recommend creating a new warehouse to run data transfer queries for Drivetrain. However, you can also choose an existing data warehouse. If Warehouse is not present already, follow the next step to create one

  1. Click on the top right button to create a new warehouse. Choose the Size as per the amount of data you need to query. You can change this later if needed.

Please make a note of the warehouse name. This detail will be needed while creating a user.

Step 2: Create a user & role

  1. We recommend creating a new user. However, you can also choose an existing user. If user is not already present, follow the next step to create one.

  2. To create a user and role, go to Admin → Users & Roles in the left navigation section.

  1. Select the Roles tab and click on the + Role button at the top right to create a custom role. This is an optional step and you can skip this if you already have a relevant role defined

  1. Then click on the + User button at the top right and fill in the details. Please choose the role that you created in the step above. Choose the warehouse that we had created or selected in the previous section as the Default Warehouse. You can also choose some Default Namespace if needed (this is optional).

If you check the checkbox against 'Force user to change password on first time login' then you must activate the user by logging into the new account and changing the password.

At the end of this step, you will get the username / password and warehouse name that you will need for the connection.

Step 3: Get Snowflake identifier details

  1. To get this, click on the Account name next to the Snowflake icon at the bottom left menu. Mouse hover to the respective Snowflake Account.

  2. Then click on the Copy icon. This will copy the Account Idetifier. This should be something like: ICKXXXX.ACCOUNT_NAME. Please note this as well.

Step 4: Add permissions to tables

  1. Please go to Data → Databases in the left navigation bar. Select the tables that you want to give permissions for.

  1. Click on the + Privilege icon and then select the role that you had created in the sections above. Choose the default privilege in the Privileges dropdown and click on Grant Privileges.

Step 5: Provide access to warehouse

  1. Execute the below command to provide warehouse access to the role defined in Step 2.

GRANT USAGE ON WAREHOUSE EXAMPLE_WAREHOUSE TO ROLE EXAMPLE_ROLE;

Connecting via key-pair

Step 1: Generate a private key

  1. Open a terminal window on your system and type the below command line:

openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt
  1. The commands generate a private key in PEM format.

-----BEGIN PRIVATE KEY----- 
MIIBIj... 
-----END PRIVATE KEY-----
  1. Make a note of this key and store securely. You will need to enter this key on Drivetrain when connecting Drivetrain to Snowflake.

Step 2: Generate a public key

  1. Open the same terminal window on which you ran the command to generate a private key and now run the below command line:

openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub
  1. The commands generate a private key in PEM format.

-----BEGIN PUBLIC KEY-----
MIIE6T...
-----END PUBLIC KEY-----
  1. Make a note of this key and store securely.

Step 3: Assign the public key to a Snowflake user

ALTER USER example_user SET RSA_PUBLIC_KEY='MIIBIjANBgkqh...';

example_user = username of the account you want to connect to Drivetrain.

While copying the public key ensure to:

  • exclude the public key delimiters in the SQL statement.

  • remove all line breaks.

Drivetrain Setup

Step 1: Connect to Snowflake

  1. Open you Drivetrain account and navigate to the Data tab, click on + New data source.

  2. Search for Snowflake.

  3. Click on Connect.

  4. Choose your preferred method for authentication and click on OK.

  1. Click on Data tab again and you will see a new connection to Snowflake.

Step 2: Import data from Snowflake

  1. Navigate to the new Snowflake connection and click on + Add data.

  2. You will see a list of all available tables. The tables follow the below nomenclature:

Schema_Name.Table_Name
  1. Select the tables from which you want to get data into Drivetrain and move them to the right side of the window.

  1. Click Add. That's it! All your relevant data from Snowflake will now be available in Drivetrain for your use.

EXAMPLE_WAREHOUSE = name of the warehouse as per .

EXAMPLE_ROLE = name of the warehouse as per .

Execute an command to assign the public key to a Snowflake user.

Fill all the fields with relevant details of your Snowflake account and click Submit. Follow the steps listed to understand how to get your Snowflake account details such as Username, Warehouse and Database.

ALTER USER
Overview of Access Control
GRANT OWNERSHIP
Prerequisites
Snowflake Setup
Creating Storage Integration
Step 1: Create storage integration with provider as GCS
Connecting via username & password
Step 1: Create a new warehouse/use an existing warehouse
Step 2: Create a user & role
Step 3: Get Snowflake identifier details
Step 4: Add permissions to tables
Step 5: Provide access to warehouse
Connecting via key-pair
Step 1: Generate a private key
Step 2: Generate a public key
Step 3: Assign the public key to a Snowflake user
Drivetrain Setup
Step 1: Connect to Snowflake
Step 2: Import data from Snowflake
Step 1
Step 2
here
Page cover image