Snowflake
Create a Role and a User
create role dot_role;
create user dot_user
password = '<something secret>' -- remember that!
default_warehouse = example_wh -- specify your warehouse
default_role = dot_role;
grant role dot_role to user dot_user;
--allow usage of your warehouse
grant usage on warehouse example_wh to role dot_role;Grants Read Access to Data
-- gives access to all objects in a schema
set db_name = 'example_db'; -- specify name of database
set schema_name = 'example_schema'; -- specify name of schema
set db_schema_name = $db_name || '.' || $schema_name;
grant usage on database identifier($db_name) to role dot_role;
grant usage on schema identifier($db_schema_name) to role dot_role;
grant select on all tables in schema identifier($db_schema_name) to role dot_role;
grant select on future tables in schema identifier($db_schema_name) to role dot_role;
grant select on all views in schema identifier($db_schema_name) to role dot_role;
grant select on future views in schema identifier($db_schema_name) to role dot_role;
grant select on all materialized views in schema identifier($db_schema_name) to role dot_role;
grant select on future materialized views in schema identifier($db_schema_name) to role dot_role;Grants Read Access to Account Information (optional)
Allow Dot IPs
Last updated