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.
语法¶
SHOW APPLICATIONS [ LIKE '<pattern>' ]
[ STARTS WITH '<name_string>' ]
[ LIMIT <rows> [ FROM '<name_string>' ] ];
参数¶
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:
列 |
描述 |
|---|---|
|
Date and time when the app was created. |
|
The name of the app. |
|
Specifies whether the app is in the default namespace for the user. |
|
Specifies whether the app is in the current session context. |
|
Specifies the source of the app. The following values are valid:
|
|
The name of the application package or listing used to create the app. |
|
The role used to create the app. |
|
Text that provides information about the app. |
|
The version identifier used to create the app. |
|
The version label of the app. This label is visible to consumers when they install an app. |
|
The patch number used to create the app. |
|
For an app, this field is always empty. |
|
The retention time of the app. |
|
The current state of the background installation or upgrade of the app. The following values are valid:
|
|
The reason why the app was disabled. For more information, see 处于禁用状态的应用程序. |
|
The timestamp when the app was last upgraded. |
|
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 |
使用说明¶
该命令不需要正在运行的仓库即可执行。
该命令仅返回当前用户的当前角色已获授至少一项访问权限的对象。
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;
+-------------------------------+------------------------+------------+------------+---------------------+----------------------------+---------------+---------+---------------------+-----------------+-------+---------+----------------+---------------+-----------+
| 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 |
+-------------------------------+------------------------+------------+------------+---------------------+----------------------------+---------------+---------+---------------------+-----------------+-------+---------+----------------+---------------+-----------+