-
Notifications
You must be signed in to change notification settings - Fork 0
/
provider_setup.sql
33 lines (25 loc) · 1.22 KB
/
provider_setup.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
CREATE APPLICATION PACKAGE if not exists ENRICHMENT_PACKAGE;
CREATE SCHEMA ENRICHMENT_PACKAGE.CODE_STAGE;
CREATE SCHEMA ENRICHMENT_PACKAGE.SHARE;
CREATE STAGE IF NOT EXISTS ENRICHMENT_PACKAGE.CODE_STAGE.APP;
GRANT USAGE ON SCHEMA ENRICHMENT_PACKAGE.SHARE TO SHARE IN APPLICATION PACKAGE ENRICHMENT_PACKAGE;
CREATE TABLE IF NOT EXISTS ENRICHMENT_PACKAGE.SHARE.METADATA(KEY STRING, VALUE OBJECT);
GRANT SELECT ON ENRICHMENT_PACKAGE.SHARE.METADATA TO SHARE IN APPLICATION PACKAGE ENRICHMENT_PACKAGE;
-- At this point, put all the files onto the stage ENRICHMENT_PACKAGE.CODE_STAGE.APP using either PUT or Snowsight
--INSTALLING APP
ALTER APPLICATION PACKAGE ENRICHMENT_PACKAGE
ADD VERSION ver1
USING '@ENRICHMENT_PACKAGE.CODE_STAGE.APP';
CREATE APPLICATION ENRICHMENT_APP
FROM APPLICATION PACKAGE ENRICHMENT_PACKAGE
USING VERSION ver1;
CREATE OR REPLACE STREAMLIT CONNECTOR_MANAGER
ROOT_LOCATION = '@ENRICHMENT_PACKAGE.CODE_STAGE.APP'
MAIN_FILE = '/streamlit_app.py'
QUERY_WAREHOUSE = XS_WH;
-- For testing, creat a patch and upgrade app on provider side
ALTER APPLICATION PACKAGE ENRICHMENT_PACKAGE
ADD PATCH FOR VERSION ver1
USING '@ENRICHMENT_PACKAGE.CODE_STAGE.APP';
ALTER APPLICATION ENRICHMENT_APP
UPGRADE USING VERSION ver1;