Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,7 @@ GRANT DATABASE ROLE SNOWFLAKE.DATA_METRIC_USER TO ROLE dcm_developer;
GRANT EXECUTE DATA METRIC FUNCTION ON ACCOUNT TO ROLE dcm_developer;

----------------------------------------------------------------------
-- 4. Create a Warehouse (optional — skip if you already have one)
----------------------------------------------------------------------
CREATE WAREHOUSE IF NOT EXISTS dcm_wh
WITH
WAREHOUSE_SIZE = 'XSMALL'
AUTO_SUSPEND = 300
COMMENT = 'For Quickstart Demo of DCM Projects';

----------------------------------------------------------------------
-- 5. Create the DCM Project Object
-- 4. Create the DCM Project Object
----------------------------------------------------------------------
USE ROLE dcm_developer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ VALUES
----------------------------------------------------------------------
-- 2. Refresh Dynamic Tables
----------------------------------------------------------------------
ALTER DYNAMIC TABLE DCM_DEMO_1_DEV.ANALYTICS.ENRICHED_ORDER_DETAILS REFRESH;
ALTER DYNAMIC TABLE DCM_DEMO_1_DEV.ANALYTICS.MENU_ITEM_POPULARITY REFRESH;
ALTER DYNAMIC TABLE DCM_DEMO_1_DEV.ANALYTICS.CUSTOMER_SPENDING_SUMMARY REFRESH;
EXECUTE DCM PROJECT dcm_demo.projects.dcm_project_dev REFRESH ALL;

----------------------------------------------------------------------
-- 3. Verify
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,14 @@
03_cleanup.sql — Run when you're done and want to tear everything down
=============================================================================*/

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

DROP DATABASE IF EXISTS dcm_demo_1_dev;
DROP WAREHOUSE IF EXISTS dcm_demo_1_wh_dev;

DROP ROLE IF EXISTS dcm_demo_1_dev_read;
DROP ROLE IF EXISTS dev_team_1_owner_dev;
DROP ROLE IF EXISTS dev_team_1_developer_dev;
DROP ROLE IF EXISTS dev_team_1_usage_dev;

USE ROLE ACCOUNTADMIN;
DROP DCM PROJECT IF EXISTS dcm_demo.projects.dcm_project_dev;
DROP SCHEMA IF EXISTS dcm_demo.projects;
DROP DATABASE IF EXISTS dcm_demo;

USE ROLE ACCOUNTADMIN;
DROP ROLE IF EXISTS dcm_developer;
DROP WAREHOUSE IF EXISTS dcm_wh;