DESCRIBE CODE BUNDLE

Describes the properties of a Code Bundle, including its versions and the source that backs it.

DESCRIBE can be abbreviated to DESC.

See also:

CREATE CODE BUNDLE, ALTER CODE BUNDLE, SHOW CODE BUNDLES, EXECUTE CODE BUNDLE

Syntax

{ DESC | DESCRIBE } CODE BUNDLE <name>

Parameters

name

Specifies the identifier of the Code Bundle to describe.

If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.

For more information, see Identifier requirements.

Output

The output of the command includes the following columns, which describe the properties and metadata of the object:

ColumnDescription
nameName of the Code Bundle.
commentComment for the Code Bundle.
default_versionThe version that runs use when they call the Code Bundle by name, for example LAST.
default_version_nameName of the default version.
default_version_aliasAlias of the default version.
default_version_location_uriLocation of the default version’s files, in the form snow://code bundle/....
default_version_source_location_uriStage or workspace path that the default version was created from.
default_version_git_commit_hashGit commit hash of the default version, if its source is backed by a Git repository.
last_version_nameName of the most recently added version.
last_version_aliasAlias of the most recently added version.
last_version_location_uriLocation of the most recently added version’s files.
last_version_source_location_uriStage or workspace path that the most recently added version was created from.
last_version_git_commit_hashGit commit hash of the most recently added version, if its source is backed by a Git repository.
live_version_location_uriLocation of the live version, if the Code Bundle has one.
created_onDate and time when the Code Bundle was created.
owner_roleRole that owns the Code Bundle.
owner_role_typeType of role that owns the Code Bundle.
container_typeType of the object that holds the Code Bundle’s source, for example Stage.
container_databaseDatabase of the object that holds the Code Bundle’s source.
container_schemaSchema of the object that holds the Code Bundle’s source.
container_nameName of the object that holds the Code Bundle’s source.

Access control requirements

A role used to execute this operation must have the following privileges at a minimum:

PrivilegeObjectNotes
USAGE or OWNERSHIPCode Bundle

For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

Usage notes

  • 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.

    For example, you can use the pipe operator or RESULT_SCAN function to select specific columns from the SHOW command output or filter the rows.

    When you refer to the output columns, use double-quoted identifiers for the column names. For example, to select the output column type, specify SELECT "type".

    You must use double-quoted identifiers because the output column names for SHOW commands are in lowercase. The double quotes ensure that the column names in the SELECT list or WHERE clause match the column names in the SHOW command output that was scanned.

Examples

Describe a Code Bundle:

DESCRIBE CODE BUNDLE my_db.my_schema.my_bundle;

Find the source location of the version that runs use:

DESCRIBE CODE BUNDLE my_db.my_schema.my_bundle;

SELECT "default_version", "default_version_source_location_uri"
  FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()));