classTriggerRule
final class TriggerRule
Lowers CREATE TRIGGER.
Rule: MYSQL-TRIGGER-LOWERING-001. Scope: trigger_tail, trg_action_time, trg_event, trigger_follows_precedes_clause, trigger_action_order. The symbols of the tail are read by rule name, so one reading serves the layouts of every release. Constructs: CreateTrigger, TriggerTable, TriggerOrder. Terminates: every child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/create-trigger.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
public function create(Node $tail, ?Account $definer): CreateTriggerLowers CREATE TRIGGER: a node of trigger_tail, and the definer.
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 1
Calls 10
- method-call Lowering::form() line 75
- class-const TriggerRule::TAILS() line 76
- static-call ImplementationGap::production() line 77
- new CreateTrigger line 90
- class-const TriggerRule::TIMES() line 92
- class-const TriggerRule::EVENTS() line 93
- new TriggerTable line 94
- method-call StatementRule::statement() line 95
- new StatementRule line 95
- method-call TriggerRule::order() line 96
public function order(Node $clause): ?TriggerOrderLowers the FOLLOWS or PRECEDES clause: a node of trigger_follows_precedes_clause; an absent clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 2
Called from 1
Calls 4
- method-call Lowering::form() line 109
- static-call ImplementationGap::production() line 114
- new TriggerOrder line 118
- class-const TriggerRule::PLACEMENTS() line 118
Private surface 5§
Implementation details, listed for orientation only.
private const TAILS = ['trigger_tail: TRIGGER_SYM remember_name sp_name trg_action_time trg_event ON …private const TIMES = ['trg_action_time: BEFORE_SYM' => \SqlSemantics\Platform\MySql\Statement\Routin…private const EVENTS = ['trg_event: INSERT' => \SqlSemantics\Platform\MySql\Statement\Routine\Trigger\…private const PLACEMENTS = ['trigger_action_order: FOLLOWS_SYM' => \SqlSemantics\Platform\MySql\Statement\…private Lowering $loweringTest cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.