Required settings

  • Account URL
  • Virtual warehouse
  • Service account
  • Database name
  • Schema name

Account URL

In order for Artie to connect to your Snowflake, we will need your account URL.

Retrieving Account URL

Script to create a service account, virtual warehouse, database and schema

BEGIN TRANSACTION;
    USE ROLE ACCOUNTADMIN; -- This combines both SYSADMIN and SECURITYADMIN

    -- IMPORTANT, PLEASE FILL THIS OUT AND SAVE THIS --
    SET ROLE_NAME = 'ARTIE_TRANSFER_ROLE';
    SET SERVICE_USER = 'ARTIE';
    SET SERVICE_PW = 'PASSWORD';
    SET DWH_NAME = UPPER('DWH');
    SET DB_NAME = UPPER('DB_NAME');
    SET SCHEMA_NAME = UPPER('public');
    -- END IMPORTANT --
    SET DB_SCHEMA_NAME = CONCAT($DB_NAME, '.', $SCHEMA_NAME);

    CREATE ROLE IF NOT EXISTS identifier($ROLE_NAME);
    CREATE USER IF NOT EXISTS identifier($SERVICE_USER)
        password = $SERVICE_PW
        default_role = $ROLE_NAME;
    GRANT ROLE identifier($role_name) to USER identifier($SERVICE_USER);
    CREATE WAREHOUSE IF NOT EXISTS identifier($DWH_NAME)
        warehouse_size = xsmall
        warehouse_type = standard
        auto_suspend = 10
        auto_resume = true
        initially_suspended = true;

    CREATE DATABASE IF NOT EXISTS identifier($DB_NAME);
    CREATE SCHEMA IF NOT EXISTS identifier($DB_SCHEMA_NAME);

    GRANT USAGE ON WAREHOUSE identifier($DWH_NAME) TO ROLE identifier($ROLE_NAME);
    GRANT USAGE ON DATABASE identifier($DB_NAME) TO ROLE identifier($ROLE_NAME);
    GRANT ALL PRIVILEGES ON SCHEMA identifier($DB_SCHEMA_NAME) TO ROLE IDENTIFIER($ROLE_NAME);

    GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA identifier($DB_SCHEMA_NAME) TO ROLE IDENTIFIER($ROLE_NAME);
    GRANT ALL PRIVILEGES ON FUTURE TABLES IN SCHEMA identifier($DB_SCHEMA_NAME) TO ROLE IDENTIFIER($ROLE_NAME);
COMMIT;

Snowflake eco mode

Snowflake eco mode is a great option if you only need faster data syncs during business hours. Click here to learn more!

Steps to enable eco mode:

  1. Edit your deployment
  2. Go into the Destinations tab
  3. Open Advanced settings and select + New schedule
  4. Define your peak hours and your time zone
  5. Define your flush rules for off-peak hours
  6. Save schedule
  7. Deploy your changes

Setting up Snowflake eco mode

Troubleshooting