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ΒΆ

The DatabaseResource this reference belongs to.

fully_qualified_nameΒΆ

Return the fully qualified name of the object this reference points to.

rootΒΆ

The Root object this reference belongs to.

Methods

drop(if_exists: bool | None = None) β†’ NoneΒΆ

Drop this stream.

Parameters:

if_exists (bool, optional) – Check the existence of this stream before dropping it. Default is None, which is equivalent to False.

Examples

Deleting a stream using its reference:

>>> stream_reference.drop()
Copy

Deleting a stream using its reference if it exists:

>>> stream_reference.drop(if_exists = True)
Copy
drop_async(if_exists: bool | None = None) β†’ PollingOperation[None]ΒΆ

An asynchronous version of drop().

Refer to PollingOperation for more information on asynchronous execution and the return type.

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
fetch_async() β†’ PollingOperation[Stream]ΒΆ

An asynchronous version of fetch().

Refer to PollingOperation for more information on asynchronous execution and the return type.