classReferenceAction
final class ReferenceAction
implements ReferenceArgument
uses Snapshot
Public API: explicitly declared with
@visibility public.An ON DELETE, ON UPDATE or ON INSERT clause of a foreign key.
Rule: SQLITE-FK-ACTION-001. The reaction applies to the child rows when the parent key is deleted or updated. An ON INSERT clause is grammatical and has no effect. Source: https://sqlite.org/foreignkeys.html#fk_actions. Status: Implemented.
$create = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('CREATE TABLE c (p REFERENCES parent ON DELETE NO ACTION)');
$action = $create->statement->columns[0]->constraints[0]->arguments[0];
[$action->event->value, $action->reaction->value] // => ['DELETE', 'NO ACTION']Properties§
public ReferenceEvent $eventpublic ReferenceReaction $reactionMethods§
public function __construct(public ReferenceEvent $event, public ReferenceReaction $reaction)Parameters
$event | ReferenceEvent | The change of the parent key |
$reaction | ReferenceReaction | What happens to the child rows |
public function render(Output $out): voidWrites the clause.
Parameters
$out | Output |
Test cases 2
Calls 2
- method-call Output::keyword() line 41
- function-call
explodeline 41
Test cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.