snowflake.core.pipe.PipeCollection | Snowflake Documentation (original) (raw)
Bases: SchemaObjectCollectionParent
[PipeResource]
Represents the collection operations of the Snowflake Pipe resource.
With this collection, you can create, iterate through, and search for pipes that you have access to in the current context.
Examples
Creaing a pipe instance:
pipes = root.databases["my_db"].schemas["my_schema"].pipes new_pipe = Pipe( ... name="my_pipe", ... comment="This is a pipe") pipes.create(new_pipe)
Attributes
database¶
The DatabaseResource this collection belongs to.
root¶
The Root object this collection belongs to.
Methods
create(pipe: Pipe, *, mode: CreateMode = CreateMode.error_if_exists) → PipeResource¶
Create a pipe in Snowflake.
Parameters:
- pipe (Pipe)
- mode (CreateMode, optional) –
One of the following strings.CreateMode.error_if_exists
: Throw an snowflake.core.exceptions.ConflictErrorif the pipe already exists in Snowflake. Equivalent to SQLcreate pipe <name> ...
.CreateMode.or_replace
: Replace if the pipe already exists in Snowflake. Equivalent to SQLcreate or replace pipe <name> ...
.CreateMode.if_not_exists
: Do nothing if the pipe already exists in Snowflake. Equivalent to SQLcreate pipe <name> if not exists...
Default value isCreateMode.error_if_exists
.
Examples
Creating a pipe in Snowflake and getting reference to it:
pipe_parameters = Pipe( ... name="my_pipe", ... comment="This is a pipe" ... )
Use the pipe collection created before to create a referece to the pipe resource
in Snowflake.
pipe_reference = pipe_collection.create(pipe_parameters)
create_async(pipe: Pipe, *, mode: CreateMode = CreateMode.error_if_exists) → PollingOperation[PipeResource]¶
An asynchronous version of create().
Refer to PollingOperation for more information on asynchronous execution and the return type.
items() → ItemsView[str, T]¶
iter(*, like: str | None = None) → Iterator[Pipe]¶
Iterate through Pipe
objects in 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 _).
Examples
Showing all pipes that you have access to see:
pipes = pipe_collection.iter()
Showing information of the exact pipe you want to see:
pipes = pipe_collection.iter(like="your-pipe-name")
Showing pipes starting with ‘your-pipe-name’:
pipes = pipe_collection.iter(like="your-pipe-name%")
Using a for loop to retrieve information from iterator:
for pipe in pipes: print(pipe.name, pipe.comment)
iter_async(*, like: str | None = None) → PollingOperation[Iterator[Pipe]]¶
An asynchronous version of iter().
Refer to PollingOperation for more information on asynchronous execution and the return type.
keys() → KeysView[str]¶
values() → ValuesView[T]¶