CREATE APPLICATION¶
Cria uma Snowflake Native App com base em um pacote de aplicativo ou listagem. Os provedores usam este comando para instalar um aplicativo em sua conta de desenvolvimento.
When this command runs, it runs the setup script to create the app.
- Consulte também:
ALTER APPLICATION, DESCRIBE APPLICATION, DROP APPLICATION, SHOW APPLICATIONS
Sintaxe¶
CREATE APPLICATION <name> FROM APPLICATION PACKAGE <package_name>
[ USING RELEASE CHANNEL { QA | ALPHA | DEFAULT } ]
[ COMMENT = '<string_literal>' ]
[ [ WITH ] TAG ( <tag_name> = '<tag_value>' [ , ... ] ) ]
[ AUTHORIZE_TELEMETRY_EVENT_SHARING = { TRUE | FALSE } ]
[ WITH FEATURE POLICY = <policy_name> ]
CREATE APPLICATION <name> FROM APPLICATION PACKAGE <package_name>
USING <path_to_version_directory>
[ DEBUG_MODE = { TRUE | FALSE } ]
[ COMMENT = '<string_literal>' ]
[ [ WITH ] TAG ( <tag_name> = '<tag_value>' [, ...] ) ]
[ AUTHORIZE_TELEMETRY_EVENT_SHARING = { TRUE | FALSE } ]
[ WITH FEATURE POLICY = <policy_name> ]
CREATE APPLICATION <name> FROM APPLICATION PACKAGE <package_name>
USING VERSION <version_identifier> [ PATCH <patch_num> ]
[ DEBUG_MODE = { TRUE | FALSE } ]
[ COMMENT = '<string_literal>' ]
[ [ WITH ] TAG ( <tag_name> = '<tag_value>' [ , ... ] ) ]
[ AUTHORIZE_TELEMETRY_EVENT_SHARING = { TRUE | FALSE } ]
[ WITH FEATURE POLICY = <policy_name> ]
CREATE APPLICATION <name> FROM LISTING <listing_name>
[ USING RELEASE CHANNEL { QA | ALPHA | DEFAULT } ]
[ COMMENT = '<string_literal>' ]
[ [ WITH ] TAG ( <tag_name> = '<tag_value>' [ , ... ] ) ]
[ BACKGROUND_INSTALL = { TRUE | FALSE } ]
[ AUTHORIZE_TELEMETRY_EVENT_SHARING = { TRUE | FALSE } ]
[ WITH FEATURE POLICY = <policy_name> ]
Parâmetros obrigatórios¶
nameSpecifies the identifier for the app. Must be unique for your account.
Além disso, o identificador deve começar com um caractere alfabético e não pode conter espaços ou caracteres especiais, a menos que toda a cadeia de caracteres do identificador esteja entre aspas duplas (por exemplo,
"My object"). Os identificadores delimitados por aspas duplas também diferenciam letras maiúsculas de minúsculas.Para obter mais detalhes, consulte Requisitos para identificadores.
FROM APPLICATION PACKAGE package_nameSpecifies the name of the application package used to create the app. To use this clause to create an app from an application package without specifying a stage or a version/patch, the application package must have a default release directive defined.
This clause can only be used to create an app in the same account as the application package. This clause cannot be used to create an app in development mode.
FROM LISTING listing_nameSpecifies the name of the listing that contains the application package used to create the app.
USING RELEASE CHANNEL QA | ALPHA | DEFAULTEspecifica o canal de lançamento definido no pacote do aplicativo ou listagem usado para criar o aplicativo. Se você não especificar esta cláusula, o canal de lançamento padrão será usado.
QAespecifica o canal de lançamento da garantia de qualidade.ALPHAespecifica o canal de lançamento alfa.DEFAULTespecifica o canal de lançamento padrão.
This clause can be used only when creating an app from an application package that has a release directive defined or when creating an app from a listing.
USING path_to_version_directorySpecifies the path to the stage that contains the files required by the app.
USING version [ PATCH patch_num ]Specifies the version, and optionally the patch, defined in the application package used to create the app.
Parâmetros opcionais¶
COMMENT = 'string_literal'Specifies a comment for the app.
Padrão: sem valor
DEBUG_MODE = { TRUE | FALSE }Enables or disables debug mode for the app being created. Debug mode allows a provider to see the contents of the app.
TRUEenables debug mode for the installed app.FAlSEdisables debug mode for the installed app.
Nota
You can only enable debug mode under the following conditions:
The app is in the same account as the application package.
The app is being created based on a specific version or from files on a named stage.
TAG ( tag_name = 'tag_value' [ , tag_name = 'tag_value' , ... ] )Especifica o nome da tag e o valor da cadeia de caracteres dela.
O valor de tag é sempre uma cadeia de caracteres, e o número máximo de caracteres do valor da tag é 256.
Para obter informações sobre como especificar tags em uma instrução, consulte Tag quotas.
BACKGROUND_INSTALL = { TRUE | FALSE }Creates the app from a listing in the background. If you specify this clause, the command returns you to the prompt immediately, and the installation process continues in the background. To monitor that status of the installation, use the DESCRIBE APPLICATION command.
Nota
When this clause is used, the app is created even if the command fails. In this situation, use the DROP APPLICATION command to delete the object before running the CREATE APPLICATION command again.
Esta cláusula é usada principalmente por Snowsight para instalar um Snowflake Native App em segundo plano. A instalação em segundo plano permite que o consumidor saia da listagem em Snowsight durante a instalação. Um provedor pode usar esta cláusula ao testar a instalação de um Snowflake Native App de uma listagem antes de publicar a listagem.
AUTHORIZE_TELEMETRY_EVENT_SHARING = { TRUE | FALSE }Habilita o registro e o compartilhamento de evento no aplicativo.
WITH FEATURE POLICY = policy_nameCrie o aplicativo com a política de recursos especificada. Se o aplicativo tentar criar um objeto que a política de recursos proíbe (como um banco de dados), o comando falhará.
Requisitos de controle de acesso¶
A função usada para executar essa operação deve ter, no mínimo, os seguintes privilégios:
Privilégio |
Objeto |
Notas |
|---|---|---|
CREATE APPLICATION |
Conta |
|
DEVELOP |
Pacote de aplicativo |
|
INSTALL |
Pacote de aplicativo |
|
IMPORT SHARE CREATE APPLICATION |
Conta |
Esses privilégios são necessários para criar um aplicativo em uma conta diferente da conta que contém o pacote de aplicativo. |
APPLY FEATURE POLICY APPLY ou OWNERSHIP |
Conta Política de recursos |
Esses privilégios são necessários para aplicar uma política de recursos ao criar o aplicativo usando a cláusula WITH FEATURE POLICY. |
Notas de uso¶
To create an app directly from an application package, you must specify a default release directive in the application package.
The app differs from a database in the following ways:
An app may not be transient.
The role with the OWNERSHIP privilege on the app has the following abilities and limitations:
Can drop the database or modify the COMMENT property and any properties that are specific to the app.
Cannot see or modify the contents of the app except via the privileges granted the application roles.
Não pode criar um objeto em nível de banco de dados, como um esquema ou uma função de banco de dados.
Em relação aos metadados:
Atenção
Os clientes devem garantir que nenhum dado pessoal (exceto para um objeto do usuário), dados sensíveis, dados controlados por exportação ou outros dados regulamentados sejam inseridos como metadados ao usar o serviço Snowflake. Para obter mais informações, consulte Campos de metadados no Snowflake.
Instruções CREATE OR REPLACE <object> são atômicas. Ou seja, quando um objeto é substituído, o objeto antigo é excluído e o novo objeto é criado em uma única transação.
Exemplos¶
CREATE APPLICATION hello_snowflake_app
FROM APPLICATION PACKAGE hello_snowflake_package
USING VERSION v1;
+---------------------------------------------------------+
| status |
|---------------------------------------------------------|
| Application 'hello_snowflake_app' created successfully. |
+---------------------------------------------------------+
CREATE APPLICATION hello_snowflake_app
FROM APPLICATION PACKAGE hello_snowflake_package
USING '@hello_snowflake_code.core.hello_snowflake_stage';
+---------------------------------------------------------+
| status |
|---------------------------------------------------------|
| Application 'hello_snowflake_app' created successfully. |
+---------------------------------------------------------+