snowflake.core.stream.StreamResource¶

class snowflake.core.stream.StreamResource(name: Annotated[str, Strict(strict=True)], collection: StreamCollection)¶

Bases: SchemaObjectReferenceMixin[StreamCollection]

Represents a reference to a Snowflake Stream resource.

With this stream reference, you can create, update, and fetch information about streams, as well as perform certain actions on them.

Attributes

database¶
fully_qualified_name¶
root¶

Methods

drop(if_exists: Annotated[bool, Strict(strict=True)] | None = False) → None¶

Drop this stream.

Parameters:

if_exists (bool, optional) – Check the existence of stream before drop. The default value is None, which is equivalent to False.

Examples

Deleting this stream using its reference:

>>> stream_reference.drop()
Copy

Deleting this stream if it exists:

>>> stream_reference.drop(if_exists = True)
Copy
fetch() → Stream¶

Fetch the details of a stream.

Examples

Fetching a stream reference to print its time of creation:

>>> print(stream_reference.fetch().created_on)
Copy