This section guides utilizing the setup script to define the objects created during the installation of your application. Additionally, it delves into the utilization of application roles and their integration within the setup script.
About the Setup Script:
Within the application, the setup script comprises SQL statements executed during the installation, upgrade, or testing phases. It is imperative for every application to include a setup script, with its location explicitly detailed in the manifest file.
The setup script serves to articulate the creation and modification of objects during the installation or upgrade of an application.
Note:
The setup script is an essential component for generating an application package. Both the name and path of the setup script are specified in the manifest.yml file.
Restrictions on the Setup Script:
The operations listed below are restricted and cannot be executed within a setup script:
- USE DATABASE
- USE SCHEMA
- USE ROLE
- USE SECONDARY ROLES
- Configuring the LOG_LEVEL or TRACE_LEVEL properties using the ALTER command.
- Creating or invoking procedures set to EXECUTE AS CALLER.
- Developing Snowpark user-defined functions (UDFs) or procedures utilizing IMPORT from a designated stage.
- Invoking procedures, functions, or anonymous code blocks incorporating extension code.
- Importing code files from a named stage when utilizing the CREATE FUNCTION command.
- Employing CALL to invoke a procedure configured with EXECUTE AS CALLER.
It's important to note that there are additional constraints on objects created within a versioned schema.