The snow object commands provide you with a convenient way of managing most Snowflake objects, such as stages, Snowpark functions, or Streamlit apps. Instead of using separate commands for each type of object, you can use these commands to perform common tasks, including the following:
The snow object create command creates a specified object based on the definition provided, using the following syntax:
snow object create TYPE ([OBJECT_ATTRIBUTES]|[--json {OBJECT_DEFINITION}])
where:
TYPE is a Snowflake object type:
account
catalog-integration
compute-pool
database
database-role
dynamic-table
event-table
external-volume
function
image-repository
managed-account
network-policy
notebook
notification-integration
pipe
procedure
role
schema
service
stage
stream
table
task
user-defined-function
view
warehouse
OBJECT_ATTRIBUTES contains the object definition in the form of a list of <key>=<value> pairs, such as:
snow object create database name=my_db comment="Created with Snowflake CLI"
--json {OBJECT_DEFINITION} contains the object definition in JSON, such as:
snow object create database --json '{"name":"my_db", "comment":"Created with Snowflake CLI"}'
Note
The following object types require a database to be identified in the connection configuration, such as config.toml, or passed to the command using the --database option.
image-repository
schema
service
table
task
To create a database object using the option-attributes parameter:
snow object create database name=my_db comment='Created with Snowflake CLI'
To create a table object using the option-attributes parameter:
You can also use the --like [-l] <pattern> to filter objects by name using a SQL LIKE pattern. For example, list function --like "my%" lists all functions that begin with my. For more information about SQL patterns syntax, see SQL LIKE Keyword (https://www.w3schools.com/sql/sql_ref_like.asp).
To list only role objects that begin with the string, public, enter the following command:
snow object list role --like public%
show roles like 'public%'
+-------------------------------------------------------------------------------
| created_on | name | is_default | is_current | ...
|----------------------------------+-------------+------------+------------+----
| 2023-02-01 15:25:04.105000-08:00 | PUBLIC | N | N | ...
| 2024-01-15 12:55:05.840000-08:00 | PUBLIC_TEST | N | N | ...
+-------------------------------------------------------------------------------
Display the description for an object of a specified type¶
The snow object describe command provides a description of an object of given type.
snow object describe TYPE IDENTIFIER
where:
TYPE is the type of the object. Use snow object describe --help for the full list of supported types.
IDENTIFIER is the name of the object. For procedures and functions, the identifier must specify arguments types, such as "hello(int,string)".
To describe a function object, enter a command similar to the following: