SHOW FILES IN ARTIFACT REPOSITORY¶
Note
This command is in preview and might not be available in all accounts.
Lists retained files in a PYPI artifact repository.
- See also:
CREATE ARTIFACT REPOSITORY, ALTER ARTIFACT REPOSITORY, DESCRIBE ARTIFACT REPOSITORY, DROP ARTIFACT REPOSITORY, SHOW ARTIFACT REPOSITORIES, SHOW PACKAGES IN ARTIFACT REPOSITORY, SHOW VERSIONS IN ARTIFACT REPOSITORY
Syntax¶
Parameters¶
LIKE 'pattern'Filters the output by file name or package name. Matching a package name also finds files whose file names use underscores instead of hyphens. The match uses SQL
LIKEpattern matching and is case-insensitive.nameName of the artifact repository.
LIMIT rowsLimits the maximum number of rows returned. The value can’t exceed the current maximum result limit, which is 10,000 by default.
Access control requirements¶
A role used to execute this operation must have the following privileges at a minimum:
| Privilege | Object | Notes |
|---|---|---|
| READ | Artifact repository | None |
Operating on an object in a schema requires at least one privilege on the parent database and at least one privilege on the parent schema.
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.
Output¶
The command returns one row per retained file with the following columns:
| Column | Description |
|---|---|
created_on | Date and time when the file was retained in the repository, returned as a timestamp with scale 3. |
name | Name of the retained file. |
package_name | Name of the package associated with the file. |
version | Version of the package. |
sha256 | SHA-256 digest of the file. |
size | File size in bytes. |
Usage notes¶
-
The command returns a maximum of ten thousand records for the specified object type, as dictated by the access privileges for the role used to execute the command.
To view results for which more than ten thousand records exist, query the corresponding view (if one exists) in the Snowflake Information Schema.
-
The command returns only published, retained files. This is the list of files that are copied from a package index into Snowflake-managed storage. Files appear only after retention completes.
-
The command supports
PYPIartifact repositories.APPLICATIONrepositories aren’t supported. -
Rows are ordered lexicographically by package name, package version, and file name.
-
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, specifySELECT "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¶
List the retained files in the my_pypi_repository repository:
List up to 10 retained files for the emoji package:
The command returns output similar to the following: