snowflake.core.dynamic_table.DynamicTableCollection

class snowflake.core.dynamic_table.DynamicTableCollection(schema: SchemaResource)

Bases: SchemaObjectCollectionParent[DynamicTableResource]

Attributes

database
root
schema

Methods

__init__(schema: SchemaResource)
create(table: DynamicTable | DynamicTableClone | str, *, clone_table: str | Clone | None = None, copy_grants: bool | None = False, mode: CreateMode = CreateMode.error_if_exists) DynamicTableResource

Create a dynamic table.

Parameters:
  • table – The dynamic table object, together with the dynamic table’s properties. It can either be a table name or a DynamicTableClone object when it’s used with clone_table. It must be a DynamicTable when it’s not used with this clause.

  • clone_table – The clone clause.

  • copy_grants – copy grants when clone_table is provided.

  • mode

    One of the following strings.

    CreateMode.error_if_exists: Throw an snowflake.core.exceptions.ConflictError if the table already exists in Snowflake. Equivalent to SQL create table <name> ....

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

    CreateMode.if_not_exists: Do nothing if the task already exists in Snowflake. Equivalent to SQL create table <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, deep: bool = False) Iterator[DynamicTable]

Search Table objects from Snowflake.

Parameters:
  • like – The pattern of the Table name. Use % to represent any number of characters and ? for a single character.

  • startswith – The table name starts with this string.

  • limit – limits the number of objects returned.

  • from_name – enables fetching the specified number of rows following the first row whose object name matches the specified string.

  • deep – fetch the sub-resources columns and constraints of every table if it’s True. Default False.

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