Skip to content

PgTriggerContext

Namespace: Ankus

Assembly: Ankus.Runtime.dll

Owns trigger metadata and detached OLD and NEW row values independently of PostgreSQL memory contexts. Transition table names remain owned strings, but the tables can only be queried during the trigger invocation.

public sealed class PgTriggerContext

Inheritance: object

Gets the immutable trigger arguments in declaration order, including empty strings.

public IReadOnlyList<string> Arguments { get; }

Value: IReadOnlyList<string>

Gets the OID of the constraint a constraint trigger implements, or zero for an ordinary trigger.

public uint ConstraintOid { get; }

Value: uint

Gets the immutable target relation descriptor, including physical dropped slots.

public PgTupleDescriptor Descriptor { get; }

Value: PgTupleDescriptor

Gets PostgreSQL’s raw trigger event bits, retaining internal deferrability flags.

public uint Event { get; }

Value: uint

Gets whether the constraint trigger is deferrable.

public bool IsDeferrable { get; }

Value: bool

Gets whether the constraint trigger is initially deferred until transaction commit.

public bool IsInitiallyDeferred { get; }

Value: bool

Gets whether this invocation operates on one row or the entire statement.

public PgTriggerLevel Level { get; }

Value: PgTriggerLevel

Gets the exact name of the trigger that fired.

public string Name { get; }

Value: string

Gets the owned proposed row for row-level INSERT and UPDATE invocations, otherwise null. Undefined generated columns are marked unavailable instead of being exposed as SQL NULL.

public PgHeapTuple? New { get; }

Value: PgHeapTuple

Gets the NEW transition relation name, or null when none was declared. The relation itself is only available during the trigger callback.

public string? NewTransitionTableName { get; }

Value: string

Gets the owned original row for row-level UPDATE and DELETE invocations, otherwise null.

public PgHeapTuple? Old { get; }

Value: PgHeapTuple

Gets the OLD transition relation name, or null when none was declared. The relation itself is only available during the trigger callback.

public string? OldTransitionTableName { get; }

Value: string

Gets the single operation that caused this invocation.

public PgTriggerOperation Operation { get; }

Value: PgTriggerOperation

Gets the target relation’s catalog OID, distinct from its row type OID.

public uint RelationOid { get; }

Value: uint

Gets the exact target table or view name.

public string TableName { get; }

Value: string

Gets the exact target relation’s schema name.

public string TableSchema { get; }

Value: string

Gets whether this invocation runs before, after, or instead of the operation.

public PgTriggerTiming Timing { get; }

Value: PgTriggerTiming

Gets the fired trigger’s catalog OID.

public uint TriggerOid { get; }

Value: uint

Gets the zero-based ordinals of the columns named by the trigger’s UPDATE OF list, or an empty list when the trigger is not column-specific.

public IReadOnlyList<int> UpdateOfColumns { get; }

Value: IReadOnlyList<int>

Gets the zero-based ordinals of the columns the triggering UPDATE assigns, or null for other operations. A column can be assigned its current value; compare Old and New to find changed values.

public IReadOnlyList<int>? UpdatedColumns { get; }

Value: IReadOnlyList<int>