classTriggerTable
final class TriggerTable
implements NamedRelation
uses Snapshot
Public API: explicitly declared with
@visibility public.The table or view a trigger watches; the rows NEW and OLD refer to are rows of it.
Rule: SQLITE-TRIGGER-TABLE-001. The name denotes a declared relation found along the schema search path; the shape follows SQLITE-TABLE-SHAPE-001. Source: https://sqlite.org/lang_createtrigger.html. Status: Implemented.
$trigger = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('CREATE TRIGGER r AFTER DELETE ON main.t BEGIN SELECT 1; END');
[$trigger->statement->table->name()->schema->value, $trigger->statement->table->name()->name->value] // => ['main', 't']Properties§
public QualifiedName $nameMethods§
public function __construct(public QualifiedName $name)Parameters
$name | QualifiedName | The table name |
public function name(): QualifiedNameAnswers the table name.
Returns
public function alias(): ?NameAnswers no correlation name: the rows are reached as NEW and OLD.
Returns
?Namepublic function deriveRelation(Derivation $derivation, Environment $environment): RelationFactResolves the name among the declared relations and derives the row shape of the table.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 3
- method-call TableShapes::fact() line 62
- new TableShapes line 62
- method-call Derivation::environment() line 62
public function render(Output $out): voidWrites the name.
Parameters
$out | Output |
Calls 3
- method-call Output::name() line 71
- class-const NameUse::Qualifier() line 71
- class-const NameUse::Relation() line 73
Test cases 10§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 9
TriggerFactsTest::testDeriveHidesTheRowThatTheEventDoesNotProvidecallsTriggerFactsTest::testDeriveMakesTheRowsOfTheEventVisibleByQualifierOnlycallsTriggerFactsTest::testDeriveReportsTriggerOnlyMisusesAndTheColumnsOfUpdateOfcallsCreateTriggerTest::testRejectsAnEmptyProgramcallsCreateTriggerTest::testRejectsAnInsertWithACorrelationNamecallsCreateTriggerTest::testRejectsAStepWithAReturningClausecallsCreateTriggerTest::testRejectsAStepWithAWithClausecallsCreateTriggerTest::testRejectsColumnsOnAnEventOtherThanUpdatecallsCreateTriggerTest::testRenderWritesEveryPartInGrammarOrdercalls