snowflake.core.event_table.EventTableCollectionΒΆ
- class snowflake.core.event_table.EventTableCollection(schema: SchemaResource)ΒΆ
Bases:
SchemaObjectCollectionParent
[EventTableResource
]Represents the collection operations on the Snowflake Event Table resource.
With this collection, you can create, iterate through, and fetch event tables that you have access to in the current context.
Initialize collection for Event Table.
Attributes
- databaseΒΆ
- rootΒΆ
Methods
- create(event_table: EventTable, *, mode: CreateMode = CreateMode.error_if_exists, copy_grants: bool | None = False) EventTableResource ΒΆ
Create an event table in Snowflake.
- Parameters:
event_table (EventTable) β
- The details of
EventTable
object, together withEventTable
βs properties: name ; rows, columns are optional
- The details of
copy_grants (bool, optional) β Whether to enable copy grants when creating the object. Default is
False
.mode (CreateMode, optional) β
One of the below enum values.
CreateMode.error_if_exists
: Throw ansnowflake.core.exceptions.ConflictError
if the event table already exists in Snowflake. Equivalent to SQLcreate event table <name> ...
.CreateMode.or_replace
: Replace if the event table already exists in Snowflake. Equivalent to SQLcreate or replace event table <name> ...
.CreateMode.if_not_exists
: Do nothing if the event table already exists in Snowflake. Equivalent to SQLcreate event table <name> if not exists...
Default value is
CreateMode.error_if_exists
.
Examples
Create an Event Table instance:
>>> event_tables = schema.event_tables >>> event_tables.create(new_event_table)
- items() ItemsView[str, T] ΒΆ
- iter(*, like: str | None = None, starts_with: str | None = None, show_limit: int | None = None, from_name: str | None = None) Iterator[EventTable] ΒΆ
Iterate through
Event Table
objects from Snowflake, filtering on any optional βlikeβ pattern.- Parameters:
like (str, optional) β A case-insensitive string functioning as a filter, with support for SQL wildcard characters (% and _).
starts_with (str, optional) β String used to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching.
show_limit (int, optional) β Limit of the maximum number of rows returned by iter(). The default is
None
, which behaves equivalently to show_limit=10000. This value must be between1
and10000
.from_name (str, optional) β Fetch rows only following the first row whose object name matches the specified string. This is case-sensitive and does not have to be the full name.
Examples
Showing all event tables that you have access to see:
>>> event_tables = event_table_collection.iter()
Showing information of the exact event table you want to see:
>>> event_tables = event_table_collection.iter(like="your-event-table-name")
Showing event tables starting with βyour-event-table-name-β:
>>> event_tables = event_table_collection.iter(like="your-event-table-name-%")
Using a for loop to retrieve information from iterator:
>>> for event_table in event_tables: ... print(event_table.name)
- keys() KeysView[str] ΒΆ
- values() ValuesView[T] ΒΆ