classTriggerFacts
final class TriggerFacts
Derives the facts of a trigger definition.
Rule: SQLITE-TRIGGER-SCOPE-001. The watched table is resolved once. The WHEN condition and every statement of the program see, under the qualifiers NEW and OLD only, a row of the watched table with its implicit columns: NEW in INSERT and UPDATE triggers, OLD in UPDATE and DELETE triggers. A column of UPDATE OF that the table certainly lacks is reported. A BEFORE or AFTER trigger, BEFORE being the default, on a view and an INSTEAD OF trigger on a table are reported (SQLITE-RELATION-KIND-001). In the program, a written table qualified with a schema, an index choice and a bind parameter are reported, as SQLite rejects them (SQLITE-PROGRAM-ONLY-001). Terminates: one pass over the program. Source: https://sqlite.org/lang_createtrigger.html. Status: Implemented.
Methods§
public function derive(CreateTrigger $trigger, Derivation $derivation): voidDerives every part of the trigger definition.
Parameters
$trigger | CreateTrigger | |
$derivation | Derivation |
Test cases 4
TriggerFactsTest::testDeriveHidesTheRowThatTheEventDoesNotProvidecallsTriggerFactsTest::testDeriveMakesTheRowsOfTheEventVisibleByQualifierOnlycallsTriggerFactsTest::testDeriveReportsAParameterAnywhereInTheProgramcallsTriggerFactsTest::testDeriveReportsTriggerOnlyMisusesAndTheColumnsOfUpdateOfcalls
Called from 1
Calls 28
- method-call Derivation::relation() line 51
- method-call Derivation::environment() line 51
- method-call RelationKinds::refuse() line 52
- new RelationKinds line 52
- class-const TriggerTiming::InsteadOf() line 53
- class-const KindRefusal::InsteadOfTrigger() line 53
- class-const TriggerTiming::After() line 54
- class-const KindRefusal::AfterTrigger() line 54
- class-const TriggerTiming::Before() line 55
- class-const KindRefusal::BeforeTrigger() line 55
- method-call TableShapes::implicit() line 57
- new TableShapes line 57
- class-const TriggerEvent::Delete() line 59
- class-const TriggerEvent::Insert() line 59
- new VisibleRelation line 61
- new Name line 61
- class-const ColumnResolver::QUALIFIED_ONLY() line 61
- new Environment line 64
- method-call MutationScope::names() line 65
- new MutationScope line 65
- method-call ProgramOnly::insideProgram() line 66
- new ProgramOnly line 66
- method-call Derivation::scalar() line 68
- method-call Derivation::report() line 74
- new Misuse line 74
- class-const MisuseRule::QualifiedTriggerTarget() line 74
- class-const MisuseRule::IndexedTriggerTarget() line 77
- method-call Derivation::query() line 81
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
TriggerFactsTest::testDeriveHidesTheRowThatTheEventDoesNotProvidecallsTriggerFactsTest::testDeriveMakesTheRowsOfTheEventVisibleByQualifierOnlycallsTriggerFactsTest::testDeriveReportsAParameterAnywhereInTheProgramcallsTriggerFactsTest::testDeriveReportsTriggerOnlyMisusesAndTheColumnsOfUpdateOfcalls