Skip to content

Commit fc382de

Browse files
committed
Snowflake updates
1 parent a30ccea commit fc382de

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

src/unify/linked-profiles/setup-guides/snowflake-setup.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Be sure to log in with a user that has read and write permissions so that Segmen
1111

1212
## Getting started
1313

14-
To begin Snowflake setup:
14+
To get started:
1515

1616
1. Log in to your Snowflake account.
1717
2. Navigate to *Worksheets*.
@@ -39,19 +39,19 @@ Enter and run the code below to create specific roles for Linked Events. All Sno
3939

4040
```sql
4141
-- create role
42-
CREATE ROLE segment_entities;
42+
GRANT USAGE ON SCHEMA <schema-name-1> TO ROLE segment_entities;
4343

4444
-- warehouse access
4545
GRANT USAGE ON WAREHOUSE segment_entities TO ROLE segment_entities;
4646

4747
-- database access
48-
GRANT USAGE ON DATABASE segment_entities TO ROLE segment_entities;
49-
GRANT CREATE SCHEMA ON DATABASE segment_entities TO ROLE segment_entities;
48+
GRANT USAGE ON DATABASE <your_database> TO ROLE segment_entities;
49+
GRANT CREATE SCHEMA ON DATABASE <your_database> TO ROLE segment_entities;
5050
```
5151
5252
## Create a new user
5353
54-
Enter and run the code below to create the username and password combination that will be used to execute queries. Make sure to enter your password where it says `my_strong_password`.
54+
Enter and run the code below to create the username and password combination that will be used to execute queries. Make sure to enter your password where it says `<my_strong_password>`.
5555
5656
```sql
5757
-- create user
@@ -71,7 +71,7 @@ To use Linked Events, you'll need to grant access to `segment_entities_user` for
7171
These tables need to live in the same database as the one used for storing sync deltas. You can give as broad or narrow of access as you require. If you give broad access to multiple schemas, you can sort through the schemas in the Segment UI to select the appropriate tables to create models from.
7272

7373
> success ""
74-
> Visit Snowflake's docs to learn more about [Snowflake schema priveleges](https://docs.snowflake.com/en/user-guide/security-access-control-privileges#schema-privileges) and [Snowflake table priveleges](https://docs.snowflake.com/en/user-guide/security-access-control-privileges#table-privileges).
74+
> Visit Snowflake's docs to learn more about [schema priveleges](https://docs.snowflake.com/en/user-guide/security-access-control-privileges#schema-privileges){:target="_blank"} and [table priveleges](https://docs.snowflake.com/en/user-guide/security-access-control-privileges#table-privileges){:target="_blank"}.
7575
7676
### Schema access
7777

@@ -89,11 +89,11 @@ Choose from the following commands to open up table level access to Segment base
8989

9090
```sql
9191
-- query data from all tables in a database
92-
GRANT SELECT ON ALL TABLES IN DATABASE segment_entities TO ROLE
92+
GRANT SELECT ON ALL TABLES IN DATABASE <your_database> TO ROLE
9393
segment_entities;
9494

9595
-- query data from future tables in a database
96-
GRANT SELECT ON FUTURE TABLES IN DATABASE segment_entities TO ROLE segment_entities;
96+
GRANT SELECT ON FUTURE TABLES IN DATABASE <your_database> TO ROLE segment_entities;
9797

9898
-- query data from all tables in a schema
9999
GRANT SELECT ON ALL TABLES IN SCHEMA <schema-name> TO ROLE
@@ -107,6 +107,8 @@ segment_entities;
107107
GRANT SELECT ON TABLE <schema-name>.<table_name> TO ROLE segment_entities;
108108
```
109109

110+
### RETL table permissions
111+
110112
If you've used RETL in your database, and added a new user, you'll need to add the following table permissions described in [Snowflake's docs](https://docs.snowflake.com/en/user-guide/security-access-control-privileges#table-privileges).
111113

112114
```sql
@@ -116,3 +118,16 @@ GRANT CREATE TABLE ON SCHEMA __segment_reverse_etl TO ROLE segment_entities;
116118

117119
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA __segment_reverse_etl TO ROLE segment_entities;
118120
```
121+
122+
### Confirm table permissions
123+
124+
To confirm table permissions, run the following command:
125+
126+
```sql
127+
use role segment_entities;
128+
use <your_database>;
129+
show schemas;
130+
select * from <your_database>.<schema-name>.<table-name> limit 10
131+
```
132+
133+
The output should match the permissions you've given in previous steps.

0 commit comments

Comments
 (0)