classTriggerRule
final class TriggerRule
Lowers trigger definitions.
Rule: SQLITE-TRIGGER-LOWER-001. Scope: trigger_decl, trigger_time, trigger_event, foreach_clause, when_clause, trigger_cmd_list, trigger_cmd, trnm, tridxby. The statements of the program keep their written order and are lowered into the same statement classes as outside a trigger. Terminates: the program is flattened iteratively. Source: https://sqlite.org/lang_createtrigger.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
public function create(Node $declaration, Node $program): CreateTriggerLowers a trigger definition from its declaration and its program.
Returns
Throws
ImplementationGap When a production has no ruleCalls 7
- static-call ImplementationGap::production() line 60
- method-call TriggerRule::timing() line 65
- method-call TriggerRule::event() line 66
- new TriggerTable line 67
- method-call TriggerRule::when() line 74
- new CreateTrigger line 76
- method-call TriggerRule::program() line 76
public function timing(Node $time): ?TriggerTimingLowers a trigger_time.
Parameters
$time | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 4
- static-call TriggerTiming::from() line 90
- function-call
strtoupperline 90 - class-const TriggerTiming::InsteadOf() line 91
- static-call ImplementationGap::production() line 92
public function event(Node $event): array{TriggerEvent, list<Name>}Lowers a trigger_event into the event and the columns of UPDATE OF.
Parameters
$event | Node |
Returns
array{TriggerEvent, list<Name>}Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 4
- static-call TriggerEvent::from() line 107
- function-call
strtoupperline 107 - class-const TriggerEvent::Update() line 108
- static-call ImplementationGap::production() line 110
Lowers a when_clause: the condition, or null when the clause is absent.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 1
- static-call ImplementationGap::production() line 126
public function program(Node $list): list<Select|ValuesClause|Compound|WithQuery|InsertRows|InsertSelect|Update|Delete>Lowers a trigger_cmd_list into the statements of the program in written order.
Parameters
$list | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 4
- static-call ImplementationGap::production() line 140
- method-call Lists::items() line 143
- new Lists line 143
- method-call TriggerRule::step() line 144
public function step(Node $command): Select|ValuesClause|Compound|WithQuery|InsertRows|InsertSelect|Update|DeleteLowers one trigger_cmd.
Parameters
$command | Node |
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 4
- method-call TriggerRule::target() line 161
- new Update line 165
- new Delete line 170
- static-call ImplementationGap::production() line 172
public function target(Node $name, ?Node $indexed): MutationTargetLowers the written table of a program statement from its trnm and its optional tridxby.
Returns
Throws
ImplementationGap When a production has no ruleCalled from 3
- method-call SqlSemantics\Platform\Sqlite\Lowering\Trigger\TriggerRule::step() packages/sql-semantics-sqlite/src/Lowering/Trigger/TriggerRule.php:161
- method-call SqlSemantics\Platform\Sqlite\Lowering\Trigger\TriggerRule::step() packages/sql-semantics-sqlite/src/Lowering/Trigger/TriggerRule.php:169
- method-call SqlSemantics\Platform\Sqlite\Lowering\Trigger\TriggerRule::step() packages/sql-semantics-sqlite/src/Lowering/Trigger/TriggerRule.php:170
Calls 4
- new QualifiedName line 186
- static-call ImplementationGap::production() line 188
- new MutationTarget line 191
- new IndexChoice line 197
Private surface 1§
Implementation details, listed for orientation only.
private Lowering $loweringTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
TriggerRuleTestcalls