From 19e42500be49c626ecfa0ab8bcf788bfe2cfd45a Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Tue, 22 Nov 2022 19:53:58 +0100 Subject: [PATCH 1/2] New permissions needed to install the AT --- .../analytics-toolbox-snowflake/overview/getting-access.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/content/analytics-toolbox-snowflake/overview/getting-access.md b/app/content/analytics-toolbox-snowflake/overview/getting-access.md index 580b7eec3..940d98905 100644 --- a/app/content/analytics-toolbox-snowflake/overview/getting-access.md +++ b/app/content/analytics-toolbox-snowflake/overview/getting-access.md @@ -58,6 +58,10 @@ CREATE SCHEMA "".carto; -- Give the carto user full access to the carto schema GRANT ALL PRIVILEGES ON SCHEMA "".carto TO ROLE carto_role; +-- Give the carto user permission to use the warehouse +GRANT OPERATE ON WAREHOUSE COMPUTE_WH TO ROLE CARTO_ROLE; +GRANT USAGE ON WAREHOUSE COMPUTE_WH TO ROLE CARTO_ROLE; + -- Grant usage to public role -- Repeat this for any other role that needs to use the toolbox GRANT USAGE ON DATABASE "" TO ROLE public; From abd6dd157e60f7a9521fd4c022d5497905e0e63b Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Thu, 24 Nov 2022 16:01:26 +0100 Subject: [PATCH 2/2] Warn about using the right role to install the AT --- .../analytics-toolbox-snowflake/overview/getting-access.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/content/analytics-toolbox-snowflake/overview/getting-access.md b/app/content/analytics-toolbox-snowflake/overview/getting-access.md index 940d98905..35e3e96a4 100644 --- a/app/content/analytics-toolbox-snowflake/overview/getting-access.md +++ b/app/content/analytics-toolbox-snowflake/overview/getting-access.md @@ -114,6 +114,10 @@ If you have a previously installed version of the Analytics Toolbox, you can che To install the functions and procedures of the Analytics Toolbox in the `carto` schema of your database, replace `@@DATABASE@@` with your database in the file `modules.sql`, and run that file in Snowflake. Please note that you must execute this file's commands in the same Worksheet where you executed all the previous statements of this installation guide. +{{% bannerNote type="warning" title="WARNING" %}} +Make sure that you're using the `CARTO_ROLE` role before executing the installation script `modules.sql` (see `USE ROLE carto_role;` above). Otherwise the functions and procedures will be owned by a different role and it won't be possible to perform automatic updates of the Analytic Toolbox. +{{%/ bannerNote %}} + You can load the script into a Worksheet by using the dropdown menu on the top right and choosing "Load Script". The "All Queries" check seems to work unreliably with large scripts, so we advice to select all the text instead (just press Control-A or Command-A if using a Mac), then press the "Run" button and confirm you want to execute all the lines. ![Setup on Snowflake Classic Web Interface](/img/analytics-toolbox-snowflake/install2.png)