Skip to content

IPgAggregate<TState, TArgs>

Namespace: Ankus

Assembly: Ankus.Runtime.dll

Defines a compiler-checked PostgreSQL aggregate transition.

public interface IPgAggregate<TState, TArgs>

Type parameters:

TState

The state, including its SQL nullability.

TArgs

One input, a tuple of inputs, or ValueTuple for no inputs.

Apply PgAggregateAttribute to the implementing class or struct. Tuple elements become separate SQL arguments. Arrays remain single SQL values. Additional interfaces supply optional final, parallel and moving capabilities.

Transition(PgAggregateContext, TState, TArgs)

Section titled “Transition(PgAggregateContext, TState, TArgs)”

Incorporates one row into the aggregate state.

public static abstract TState Transition(PgAggregateContext context, TState state, TArgs arguments)

Parameters:

context — PgAggregateContext

The current aggregate invocation and state owner.

state — TState

The current state.

arguments — TArgs

The row’s aggregated inputs.

Returns: TState

The updated state.