Snowflake
Prerequisitesโ
Step 1: Set up Whaly-specific entities in Snowflakeโ
-- Set variables
set whaly_scratch_database = 'SCRATCH';
set whaly_scratch_schema = 'SCRATCH';
-- This shouldn't be modified
set whaly_bi_role = 'WHALY_BI_ROLE';
begin;
-- change role to sysadmin for warehouse / database steps
use role sysadmin;
-- create Whaly scratch database
create database if not exists identifier($whaly_scratch_database);
-- grant Whaly database access
grant OWNERSHIP
on database identifier($whaly_scratch_database)
to role identifier($whaly_bi_role);
-- create scratch schema
use database identifier($whaly_scratch_database);
create schema if not exists identifier($whaly_scratch_schema);
grant OWNERSHIP on schema identifier($whaly_scratch_schema)
to role identifier($whaly_bi_role);
commit;Last updated
Was this helpful?
