Snowflake
Prerequisitesโ
Step 1: Set up Whaly-specific entities in Snowflakeโ
-- set variables (these need to be uppercase)
set whaly_dataloading_username = 'WHALY_DATALOADING_USER';
set whaly_dataloading_password = 'you_should_change_me';
-- This shouldn't be modified
set whaly_dataloading_role = 'WHALY_DATALOADING_ROLE';
set whaly_dataloading_warehouse = 'WHALY_DATALOADING_WAREHOUSE';
set whaly_dataloading_database = 'WHALY_DATALOADING_DATABASE';
set whaly_bi_role = 'WHALY_BI_ROLE';
begin;
-- create Whaly roles
use role securityadmin;
create role if not exists identifier($whaly_dataloading_role);
grant role identifier($whaly_dataloading_role) to role SYSADMIN;
-- create Whaly users
create user if not exists identifier($whaly_dataloading_username)
password = $whaly_dataloading_password
default_role = $whaly_dataloading_role
default_warehouse = $whaly_dataloading_warehouse;
grant role identifier($whaly_dataloading_role)
to user identifier($whaly_dataloading_username);
-- change role to sysadmin for warehouse / database steps
use role sysadmin;
-- create Whaly warehouses
create warehouse if not exists identifier($whaly_dataloading_warehouse)
warehouse_size = xsmall
warehouse_type = standard
auto_suspend = 1800
auto_resume = true
initially_suspended = true
statement_timeout_in_seconds = 600;
-- grant Whaly Warehouse access
grant USAGE
on warehouse identifier($whaly_dataloading_warehouse)
to role identifier($whaly_dataloading_role);
-- create Whaly data loading database
create database if not exists identifier($whaly_dataloading_database);
-- grant Whaly database access
grant OWNERSHIP
on database identifier($whaly_dataloading_database)
to role identifier($whaly_dataloading_role);
grant USAGE
on database identifier($whaly_dataloading_database)
to role identifier($whaly_bi_role);
commit;Step 2: Set up Snowflake dataloading credentials in Whaly
Field
Description

Last updated
Was this helpful?
