Skip to content

Create transient

Create transient projection.

create_transient_projection(stub, name, query, **kwargs)

Creates a one time projection.

Source code in src/eventstore_grpc/projections/create_transient.py
def create_transient_projection(
    stub: projections_pb2_grpc.ProjectionsStub,
    name: str,
    query: str,
    **kwargs,
) -> projections_pb2.CreateResp:
    """Creates a one time projection."""
    request = projections_pb2.CreateReq()
    options = projections_pb2.CreateReq.Options()
    transient = projections_pb2.CreateReq.Options.Transient()
    transient.name = name
    options.transient.CopyFrom(transient)
    options.query = query
    request.options.CopyFrom(options)
    response = stub.Create(request, **kwargs)
    return response