final class TriggerRule
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.

Lowers triggers and event triggers.

Rule: PG-TRIGGER-LOWER-001. Scope: CreateTrigStmt, TriggerActionTime, TriggerEvents, TriggerOneEvent, TriggerReferencing, TriggerTransitions, TriggerTransition, TransitionOldOrNew, TransitionRowOrTable, TransitionRelName, TriggerForSpec, TriggerForOptEach, TriggerForType, TriggerWhen, TriggerFuncArgs, TriggerFuncArg, OptConstrFromTable, FUNCTION_or_PROCEDURE, CreateEventTrigStmt, event_trigger_when_list, event_trigger_when_item, event_trigger_value_list, AlterEventTrigStmt, enable_trigger. EACH and the choice of FUNCTION or PROCEDURE are noise (TableNoise). Termination: lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/sql-createtrigger.html, https://www.postgresql.org/docs/17/sql-createeventtrigger.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe hub
public function transitions(Node $clause): list<TriggerTransition>
public function level(Node $clause): ?bool

Lowers TriggerForSpec: true for ROW, false for STATEMENT, null when not written.

Parameters

$clauseNode

Returns

?bool

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 1
Calls 2
public function filters(Node $list): list<EventFilter>

Lowers event_trigger_when_list.

Parameters

$listNode

Returns

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 1
Calls 4
public function alterEventTrigger(Node $statement): AlterEventTrigger

Private surface 3§

Implementation details, listed for orientation only.

private const EVENTS = ['TriggerOneEvent: INSERT' => \SqlSemantics\Platform\PostgreSql\Statement\Table…
private const STATES = ['enable_trigger: ENABLE_P' => \SqlSemantics\Platform\PostgreSql\Statement\Tabl…
private Lowering $lowering

Test cases 11§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 11

Relations§

Instantiated in 3
Method calls 3