snowflake.core.schema.SchemaResource¶
- class snowflake.core.schema.SchemaResource(name: str, collection: SchemaCollection)¶
Bases:
DatabaseObjectReferenceMixin[SchemaCollection]Represents a reference to a Snowflake schema.
With this schema reference, you can create, update, and fetch information about schemas, as well as perform certain unique actions on them.
Attributes
- alerts¶
The AlertCollection of all alerts contained in this schema.
Examples
Getting all alerts in
my_schema:
- cortex_search_services¶
The CortexSearchServiceCollection of all cortex services contained in this schema.
Examples
Getting all cortex search services in
my_schema:
- database¶
The DatabaseResource this reference belongs to.
- dynamic_tables¶
The DynamicTableCollection of all dynamic tables contained in this schema.
Examples
Getting all dynamic tables in
my_schema:
- event_tables¶
The EventCollection of all events contained in this schema.
Examples
Getting all events in
my_schema:
- functions¶
The FunctionCollection of all functions contained in this schema.
Examples
Getting all functions in
my_schema:
- iceberg_tables¶
The IcebergTableCollection of all dynamic tables contained in this schema.
Examples
Getting all Iceberg tables in
my_schema:
- image_repositories¶
The ImageRepositoryCollection of all image repositories in this schema.
Examples
Getting all image repositories in
my_schema:
- notebooks¶
The NotebookCollection of all notebooks contained in this schema.
Examples
Getting all notebooks in
my_schema:
- pipes¶
The PipesCollection of all pipes in this schema.
Examples
Getting all pipes in
my_schema:
- procedures¶
Returns the
ProcedureCollectionthat represents the visible procedures.Examples
Getting a specific procedure resource:
- qualified_name¶
Return the qualified name of the object this reference points to.
- root¶
The Root object this reference belongs to.
- services¶
The ServiceCollection of all services contained in this schema.
Examples
Getting all services in
my_schema:
- stages¶
The StageCollection of all stages contained in this schema.
Examples
Getting all stages in
my_schema:
- streams¶
The StreamCollection of all streams contained in this schema.
Examples
Getting all streams in
my_schema:
- tables¶
The TableCollection of all tables contained in this schema.
Examples
Getting all tables in
my_schema:
- tasks¶
The TaskCollection of all tasks contained in this schema.
Examples
Getting all tasks in
my_schema:
- user_defined_functions¶
The UserDefinedFunctionCollection of all user defined functions contained in this schema.
Examples
Get all user defined functions in
my_schema:
- views¶
The ViewCollection of all views contained in this schema.
Examples
Getting all views in
my_schema:
Methods
- create_or_alter(schema: ModelSchemaModel) SchemaResource¶
Create, or alter-in-place a schema in Snowflake.
- Parameters:
schema (SchemaResource) – An instance of
Schema, the definition of schema we should create.
Examples
Create a schema from a reference:
- create_or_alter_async(schema: ModelSchemaModel) PollingOperation[SchemaResource]¶
An asynchronous version of
create_or_alter().Refer to
PollingOperationfor more information on asynchronous execution and the return type.
- create_or_update(schema: ModelSchemaModel) SchemaResource¶
Create, or update-in-place a schema in Snowflake.
- Parameters:
schema (SchemaResource) – An instance of
Schema, the definition of schema we should create.
Examples
Create a schema from a reference:
- delete(if_exists: bool | None = None) None¶
Delete this schema.
- Parameters:
if_exists (bool, optional) – Check the existence of this schema before dropping it. Default is
None, which is equivalent toFalse.
Examples
Deleting a schema using its reference, erroring if it doesn’t exist:
Deleting a schema using its reference, if it exists:
- drop(if_exists: bool | None = None) None¶
Drop this schema.
- Parameters:
if_exists (bool, optional) – Check the existence of this schema before dropping it. Default is
None, which is equivalent toFalse.
Examples
Dropping a schema using its reference, erroring if it doesn’t exist:
Dropping a schema using its reference, if it exists:
- drop_async(if_exists: bool | None = None) PollingOperation[None]¶
An asynchronous version of
drop().Refer to
PollingOperationfor more information on asynchronous execution and the return type.
- fetch() ModelSchemaModel¶
Fetch the details of a schema.
Examples
Fetching a reference to a schema to print its name and whether it’s our current one.
- fetch_async() PollingOperation[ModelSchemaModel]¶
An asynchronous version of
fetch().Refer to
PollingOperationfor more information on asynchronous execution and the return type.
- undrop() None¶
Undrop this previously dropped schema if it hasn’t been purged yet.
Examples
Undropping a schema using its reference:
- undrop_async() PollingOperation[None]¶
An asynchronous version of
undrop().Refer to
PollingOperationfor more information on asynchronous execution and the return type.