Skip to content

Commit 5daf69b

Browse files
committed
fix SQL syntax highlighting
1 parent 93ac098 commit 5daf69b

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

src/unify/data-graph/setup-guides/databricks-setup.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ If you already have a Service Principal user you'd like to use, grant it "Can us
4343
> Segment recommends creating a new database for the Data Graph.
4444
> If you choose to use an existing database that has also been used for [Segment Reverse ETL](/docs/connections/reverse-etl/), you must follow the [additional instructions](#update-user-access-for-segment-reverse-etl-catalog) to update user access for the Segment Reverse ETL catalog.
4545
46-
```SQL
46+
```sql
4747
CREATE CATALOG IF NOT EXISTS `SEGMENT_LINKED_PROFILES_DB`;
4848
-- Copy the saved Client ID from previously generated secret
4949
GRANT USAGE ON CATALOG `SEGMENT_LINKED_PROFILES_DB` TO `${client_id}`;
@@ -55,14 +55,14 @@ GRANT SELECT ON CATALOG `SEGMENT_LINKED_PROFILES_DB` TO `${client_id}`;
5555

5656
Run the following SQL to grant the Data Graph read-only access to the Profiles Sync catalog:
5757

58-
```SQL
58+
```sql
5959
GRANT USAGE, SELECT, USE SCHEMA ON CATALOG `${profiles_sync_catalog}` TO `${client_id}`;
6060
```
6161

6262
## Step 4: Grant read-only access to additional catalogs for the Data Graph
6363
Run the following SQL to grant your Service Principal user read-only access to any additional catalogs you want to use for the Data Graph.
6464

65-
```SQL
65+
```sql
6666
-- ********** REPEAT THIS COMMAND FOR EACH CATALOG YOU WANT TO USE FOR THE DATA GRAPH **********
6767
GRANT USAGE, SELECT, USE SCHEMA ON CATALOG `${catalog}` TO `${client_id}`;
6868
```
@@ -73,18 +73,17 @@ GRANT USAGE, SELECT, USE SCHEMA ON CATALOG `${catalog}` TO `${client_id}`;
7373

7474
Restrict access to specific schemas by running the following SQL:
7575

76-
```SQL
76+
```sql
7777
GRANT USAGE ON CATALOG `${catalog}` TO `${client_id}`;
7878
USE CATALOG `${catalog}`;
7979
GRANT USAGE, SELECT ON SCHEMA `${schema_1}` TO `${client_id}`;
8080
GRANT USAGE, SELECT ON SCHEMA `${schema_2}` TO `${client_id}`;
8181
...
82-
8382
```
8483
### Restrict read-only access to tables
8584
Restrict access to specific tables by running the following SQL:
8685

87-
```SQL
86+
```sql
8887
GRANT USAGE ON CATALOG `${catalog}` TO `${client_id}`;
8988
USE CATALOG `${catalog}`;
9089
GRANT USAGE ON SCHEMA `${schema_1}` TO `${client_id}`;
@@ -102,7 +101,7 @@ Sign in to the [Databricks CLI with your Client ID secret](https://docs.databric
102101
> success ""
103102
> If this command succeeds, you can view the table.
104103
105-
```SQL
104+
```sql
106105
USE DATABASE ${linked_read_only_database} ;
107106
SHOW SCHEMAS;
108107
SELECT * FROM ${schema}.${table} LIMIT 10;
@@ -128,6 +127,6 @@ To connect your warehouse to the Data Graph:
128127
## Update user access for Segment Reverse ETL catalog
129128
If Segment Reverse ETL has ever run in the catalog you are configuring as the Segment connection catalog, a Segment-managed schema is already created and you need to provide the new Segment user access to the existing catalog. Run the following SQL if you run into an error on the Segment app indicating that the user doesn’t have sufficient privileges on an existing `_segment_reverse_etl` catalog.
130129

131-
```SQL
130+
```sql
132131
GRANT ALL PRIVILEGES ON SCHEMA ${segment_internal_catalog}.__segment_reverse_etl TO `${client_id}`;
133132
```

src/unify/data-graph/setup-guides/snowflake-setup.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Segment recommends setting up a new Snowflake user and only giving this user per
2626
> If you choose to use an existing database that has also been used for [Segment Reverse ETL](/docs/connections/reverse-etl/), you must follow the [additional instructions](#update-user-access-for-segment-reverse-etl-schema)to update user access for the Segment Reverse ETL schema.
2727
2828

29-
```SQL
29+
```sql
3030
-- ********** SET UP THE FOLLOWING WAREHOUSE PERMISSIONS **********
3131

3232
-- Update the following variables
@@ -82,7 +82,7 @@ GRANT CREATE SCHEMA ON DATABASE identifier($segment_connection_db) TO ROLE iden
8282

8383
Next, give the Segment role **read-only** access to additional databases you want to use for Data Graph including the Profiles Sync database. Repeat the following SQL query for **each** database you want to use for the Data Graph.
8484

85-
``` SQL
85+
```sql
8686

8787
SET segment_connection_role = 'SEGMENT_LINKED_ROLE';
8888

@@ -107,7 +107,7 @@ GRANT SELECT ON FUTURE MATERIALIZED VIEWS IN DATABASE identifier($linked_read_on
107107

108108
If you want to restrict access to specific [Snowflake schemas and tables](https://docs.snowflake.com/en/user-guide/security-access-control-privileges#table-privileges){:target="_blank"}, then run the following commands:
109109

110-
```SQL
110+
```sql
111111
-- [Optional] Further restrict access to only specific schemas and tables
112112
SET db = 'MY_DB';
113113
SET schema = 'MY_DB.MY_SCHEMA_NAME';
@@ -131,7 +131,7 @@ GRANT SELECT ON FUTURE MATERIALIZED VIEWS IN SCHEMA identifier($linked_read_only
131131

132132
To verify you have set up the right permissions for a specific table, log in with the username and password you created for `SEGMENT_CONNECTION_USERNAME` and run the following command to verify the role you created has the correct permissions. If this command succeeds, you should be able to view the respective table.
133133

134-
``` SQL
134+
```sql
135135
set segment_connection_role = 'SEGMENT_LINKED_ROLE';
136136
set linked_read_only_database = 'YOUR_DB';
137137
set table_name = 'YOUR_DB.SCHEMA.TABLE';
@@ -163,12 +163,11 @@ To connect your warehouse to the Data Graph:
163163
## Update user acccess for Segment Reverse ETL schema
164164
If Segment Reverse ETL has ever run in the database you are configuring as the Segment connection database, a Segment-managed schema is already created and you need to provide the new Segment user access to the existing schema. Run the following SQL if you run into an error on the Segment app indicating that the user doesn't have sufficient privileges on an existing `_segment_reverse_etl` schema.
165165

166-
``` SQL
166+
```sql
167167
-- If you want to use an existing database that already has Segment Reverse ETL schemas, you’ll need to run some additional steps below to grant the role access to the existing schemas.
168168

169169
SET retl_schema = concat($segment_connection_db,'.__segment_reverse_etl');
170170
GRANT USAGE ON SCHEMA identifier($retl_schema) TO ROLE identifier($segment_connection_role);
171171
GRANT CREATE TABLE ON SCHEMA identifier($retl_schema) TO ROLE identifier($segment_connection_role);
172172
GRANT SELECT,INSERT,UPDATE,DELETE ON ALL TABLES IN SCHEMA identifier($retl_schema) TO ROLE identifier($segment_connection_role);
173-
174173
```

0 commit comments

Comments
 (0)