Skip to content

Commit 6dd31c9

Browse files
Merge pull request #25 from Snowflake-Labs/dcm-get-started-refactor
DCM Part 1: address PR review feedback
2 parents 2840f90 + c296951 commit 6dd31c9

3 files changed

Lines changed: 6 additions & 23 deletions

File tree

Quickstarts/get-started-snowflake-dcm-projects/scripts/01_pre_deploy.sql

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,7 @@ GRANT DATABASE ROLE SNOWFLAKE.DATA_METRIC_USER TO ROLE dcm_developer;
3333
GRANT EXECUTE DATA METRIC FUNCTION ON ACCOUNT TO ROLE dcm_developer;
3434

3535
----------------------------------------------------------------------
36-
-- 4. Create a Warehouse (optional — skip if you already have one)
37-
----------------------------------------------------------------------
38-
CREATE WAREHOUSE IF NOT EXISTS dcm_wh
39-
WITH
40-
WAREHOUSE_SIZE = 'XSMALL'
41-
AUTO_SUSPEND = 300
42-
COMMENT = 'For Quickstart Demo of DCM Projects';
43-
44-
----------------------------------------------------------------------
45-
-- 5. Create the DCM Project Object
36+
-- 4. Create the DCM Project Object
4637
----------------------------------------------------------------------
4738
USE ROLE dcm_developer;
4839

Quickstarts/get-started-snowflake-dcm-projects/scripts/02_post_deploy.sql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ VALUES
100100
----------------------------------------------------------------------
101101
-- 2. Refresh Dynamic Tables
102102
----------------------------------------------------------------------
103-
ALTER DYNAMIC TABLE DCM_DEMO_1_DEV.ANALYTICS.ENRICHED_ORDER_DETAILS REFRESH;
104-
ALTER DYNAMIC TABLE DCM_DEMO_1_DEV.ANALYTICS.MENU_ITEM_POPULARITY REFRESH;
105-
ALTER DYNAMIC TABLE DCM_DEMO_1_DEV.ANALYTICS.CUSTOMER_SPENDING_SUMMARY REFRESH;
103+
EXECUTE DCM PROJECT dcm_demo.projects.dcm_project_dev REFRESH ALL;
106104

107105
----------------------------------------------------------------------
108106
-- 3. Verify

Quickstarts/get-started-snowflake-dcm-projects/scripts/03_cleanup.sql

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,14 @@
22
03_cleanup.sql — Run when you're done and want to tear everything down
33
=============================================================================*/
44

5+
-- PURGE drops every object the project created: databases, warehouses, roles,
6+
-- grants, tables, dynamic tables, views — everything managed by the project.
57
USE ROLE dcm_developer;
8+
EXECUTE DCM PROJECT dcm_demo.projects.dcm_project_dev PURGE;
69

7-
DROP DATABASE IF EXISTS dcm_demo_1_dev;
8-
DROP WAREHOUSE IF EXISTS dcm_demo_1_wh_dev;
9-
10-
DROP ROLE IF EXISTS dcm_demo_1_dev_read;
11-
DROP ROLE IF EXISTS dev_team_1_owner_dev;
12-
DROP ROLE IF EXISTS dev_team_1_developer_dev;
13-
DROP ROLE IF EXISTS dev_team_1_usage_dev;
14-
15-
USE ROLE ACCOUNTADMIN;
1610
DROP DCM PROJECT IF EXISTS dcm_demo.projects.dcm_project_dev;
1711
DROP SCHEMA IF EXISTS dcm_demo.projects;
1812
DROP DATABASE IF EXISTS dcm_demo;
1913

14+
USE ROLE ACCOUNTADMIN;
2015
DROP ROLE IF EXISTS dcm_developer;
21-
DROP WAREHOUSE IF EXISTS dcm_wh;

0 commit comments

Comments
 (0)