SHOW APPLICATIONS

Lists the Snowflake Native Apps that you have access privileges for across your entire account.

The output returns metadata and properties for the app, ordered lexicographically by name. This is important to note if you want to filter the results using the provided filters.

另请参阅:

ALTER APPLICATIONCREATE APPLICATIONDESCRIBE APPLICATIONDROP APPLICATION

语法

SHOW APPLICATIONS [ LIKE '<pattern>' ]
  [ STARTS WITH '<name_string>' ]
  [ LIMIT <rows> [ FROM '<name_string>' ] ];
Copy

参数

LIKE 'pattern'

(可选)按对象名称筛选命令输出。筛选器使用 不区分大小写 的模式匹配,并支持 SQL 通配符(%_)。

例如,以下模式返回 相同的 结果:

... LIKE '%testing%' ...
... LIKE '%TESTING%' ...

. 默认:无值(不对输出应用筛选)。

STARTS WITH 'name_string'

(可选)根据对象名称开头显示的字符筛选命令输出。该字符串必须放在单引号内并且 区分大小写

例如,以下字符串会返回 不同的 结果:

... STARTS WITH 'B' ...
... STARTS WITH 'b' ...

. 默认:无值(不对输出应用筛选)

LIMIT rows [ FROM 'name_string' ]

(可选)限制返回的最大行数,同时还对结果启用“分页”功能。返回的实际行数可能小于指定的限制。例如,现有对象的数量小于指定的限制。

可选的 FROM 'name_string' 分子句实际上会充当结果的“游标”。这样就可以提取对象名称与指定字符串匹配的第一行之后的指定行数:

  • 该字符串必须放在单引号内并且 区分大小写

  • 该字符串不必包含完整的对象名称;支持部分名称。

默认:无值(不对输出应用限制)

备注

对于支持 FROM 'name_string'STARTS WITH 'name_string' 的 SHOW 子句,您可以将这两个子句组合在同一语句中。但是,两个条件都必须满足,否则它们相互抵消,不返回任何结果。

此外,对象按名称的字典顺序返回,因此 FROM 'name_string' 仅返回字典值高于 STARTS WITH 'name_string' 所返回行的行。

例如:

  • ... STARTS WITH 'A' LIMIT ... FROM 'B' 不会返回任何结果。

  • ... STARTS WITH 'B' LIMIT ... FROM 'A' 不会返回任何结果。

  • ... STARTS WITH 'A' LIMIT ... FROM 'AB' 将返回结果(如果有任何行与输入字符串匹配)。

输出

The command output provides app properties and metadata in the following columns:

描述

created_on

Date and time when the app was created.

name

The name of the app.

is_default

Specifies whether the app is in the default namespace for the user.

is_current

Specifies whether the app is in the current session context.

source_type

Specifies the source of the app. The following values are valid:

  • APPLICATION PACKAGE

  • LISTING

source

The name of the application package or listing used to create the app.

owner

The role used to create the app.

comment

Text that provides information about the app.

version

The version identifier used to create the app.

label

The version label of the app. This label is visible to consumers when they install an app.

patch

The patch number used to create the app.

options

For an app, this field is always empty.

retention_time

The retention time of the app.

upgrade_state

The current state of the background installation or upgrade of the app. The following values are valid:

  • INSTALLING:应用程序对象正在创建过程中。

  • INSTALL_FAILED:应用程序对象创建失败。应用程序对象会一直处于 INSTALL_FAILED 状态,直到被删除。有关安装或升级失败的原因的信息,请参阅 DESCRIBE APPLICATION 命令的 UPGRADE_FAILURE_REASON 列。

  • COMPLETE:已成功完成安装脚本,并已创建或升级应用程序对象。

  • QUEUED:应用程序对象处于升级队列中。

  • UPGRADING:应用程序对象正在升级过程中。

  • FAILED:所有升级尝试均失败。如果存在,失败的原因将在 UPGRADE_FAILURE_REASON 列中列出。实例将保持 FAILED 状态,直到版本指令更新为指向与 TARGET_UPGRADE_VERSION 列中定义的升级目标版本不同的版本。

  • QUEUED_RETRY:实例在一次或多次升级尝试中失败。UPGRADE_FAILURE_REASON 中指明了失败的原因:实例排队等待执行另一次升级尝试。

  • DISABLED:应用程序对象及其升级已禁用。在这种状态下,使用者将无法访问该实例,也不会考虑对其进行升级,更不会阻止应用程序包版本的删除。如果存在,失败的原因将在 UPGRADE_FAILURE_REASON 列中列出。

disablement_reasons

The reason why the app was disabled. For more information, see 处于禁用状态的应用程序.

last_upgraded_on

The timestamp when the app was last upgraded.

release_channel_name

The name of the release channel used to create the app. If the app was not created from a release channel, the value of this property is default.

使用说明

  • 该命令不需要正在运行的仓库即可执行。

  • 该命令仅返回当前用户的当前角色已获授至少一项访问权限的对象。

  • MANAGE GRANTS 访问权限隐式允许其持有者查看账户中的每个对象。默认情况下,只有账户管理员(具有 ACCOUNTADMIN 角色的用户)和安全管理员(具有 SECURITYADMIN 角色的用户)才具有 MANAGE GRANTS 权限。

  • To post-process the output of this command, you can use the pipe operator (->>) or the RESULT_SCAN function. Both constructs treat the output as a result set that you can query.

    The output column names for this command are generated in lowercase. If you consume a result set from this command with the pipe operator or the RESULT_SCAN function, use double-quoted identifiers for the column names in the query to ensure that they match the column names in the output that was scanned. For example, if the name of an output column is type, then specify "type" for the identifier.

示例

SHOW APPLICATIONS;
Copy
+-------------------------------+------------------------+------------+------------+---------------------+----------------------------+---------------+---------+---------------------+-----------------+-------+---------+----------------+---------------+-----------+
| created_on                    | name                   | is_default | is_current | source_type         | source                     | owner         | comment | version             | label           | patch | options | retention_time | upgrade_state | type      |
|-------------------------------+------------------------+------------+------------+---------------------+----------------------------+---------------+---------+---------------------+-----------------+-------+---------+----------------|---------------+-----------+
| 2023-02-03 10:14:09.828 -0800 | hello_snowflake_app    | N          | Y          | APPLICATION PACKAGE | hello_snowflake_package    | PROVIDER_ROLE |         | v1                  | Version v1      |     0 |         | 1              | COMPLETE      | NATIVE    |
| 2023-03-22 16:12:40.373 -0700 | PRODUCTION_APP         | Y          | Y          | APPLICATION PACKAGE | hello_snowflake_package    | PROVIDER_ROLE |         | v2                  | Version v2      |     0 |         | 1              | COMPLETE      | NATIVE    |
+-------------------------------+------------------------+------------+------------+---------------------+----------------------------+---------------+---------+---------------------+-----------------+-------+---------+----------------+---------------+-----------+
语言: 中文