snowflake.core.schema.SchemaCollection

class snowflake.core.schema.SchemaCollection(database: DatabaseResource, root: Root)

Bases: ObjectCollection[SchemaResource]

Attributes

database
root

Methods

__init__(database: DatabaseResource, root: Root) None
create(schema: ModelSchemaModel, *, clone: str | Clone | None = None, mode: CreateMode = CreateMode.error_if_exists, kind: str = '') SchemaResource

Create a schema in Snowflake.

Parameters:
  • schema – an instance of Schema.

  • mode

    One of the following strings. CreateMode.error_if_exists: Throw an snowflake.core.exceptions.ConflictError if the schem already exists in Snowflake. Equivalent to SQL create schema <name> ....

    CreateMode.or_replace: Replace if the schema already exists in Snowflake. Equivalent to SQL create or replace schema <name> ....

    CreateMode.if_not_exists: Do nothing if the schema already exists in Snowflake. Equivalent to SQL create schema <name> if not exists...

    Default value is CreateMode.error_if_exists.

items() ItemsView[str, T]
iter(*, like: str | None = None, starts_with: str | None = None, limit: int | None = None, from_name: str | None = None) Iterator[ModelSchemaModel]

Look up schemas in Snowflake.

keys() KeysView[str]
values() ValuesView[T]