classReferenceRule
final class ReferenceRule
Lowers REFERENCES clauses.
Rule: MYSQL-REFERENCES-LOWERING-001. Scope: references, opt_references, opt_ref_list, ref_list, reference_list, opt_match_clause, opt_on_update_delete, delete_option. The referential actions are kept in written order. Constructs: References, ReferentialAction. Terminates: lists are flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/create-table-foreign-keys.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
public function references(Node $references): ReferencesLowers a REFERENCES clause: a node of references.
Parameters
$references | Node |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 3
- method-call SqlSemantics\Platform\MySql\Lowering\TableDefinition\ElementRule::element() packages/sql-semantics-mysql/src/Lowering/TableDefinition/ElementRule.php:100
- method-call SqlSemantics\Platform\MySql\Lowering\TableDefinition\Key\KeyRule::element() packages/sql-semantics-mysql/src/Lowering/TableDefinition/Key/KeyRule.php:76
- method-call SqlSemantics\Platform\MySql\Lowering\TableDefinition\Key\ReferenceRule::optional() packages/sql-semantics-mysql/src/Lowering/TableDefinition/Key/ReferenceRule.php:105
Calls 6
- static-call ImplementationGap::production() line 84
- function-call
array_key_existsline 87 - class-const ReferenceRule::MATCHES() line 87
- new References line 91
- method-call ReferenceRule::columns() line 91
- method-call ReferenceRule::actions() line 91
public function optional(Node $references): ?ReferencesLowers an optional REFERENCES clause: a node of opt_references.
Parameters
$references | Node |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\MySql\Lowering\TableDefinition\ElementRule::element() packages/sql-semantics-mysql/src/Lowering/TableDefinition/ElementRule.php:97
- method-call SqlSemantics\Platform\MySql\Lowering\TableDefinition\TableDefinitionRules::columnSpecification() packages/sql-semantics-mysql/src/Lowering/TableDefinition/TableDefinitionRules.php:124
Calls 2
- method-call ReferenceRule::references() line 105
- static-call ImplementationGap::production() line 106
Lowers the parent column list: a node of opt_ref_list; no list is null.
Parameters
$list | Node |
Returns
list<Name>|nullThrows
ImplementationGap When a production has no ruleTest cases 1
Called from 1
Calls 4
- static-call ImplementationGap::production() line 123
- method-call Spine::items() line 126
- new Spine line 126
- class-const ReferenceRule::COLUMNS() line 126
public function actions(Node $clause): list<ReferentialAction>Lowers the referential actions: a node of opt_on_update_delete.
Parameters
$clause | Node |
Returns
list<ReferentialAction>Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 1
Calls 4
- class-const ReferenceRule::ACTIONS() line 143
- static-call ImplementationGap::production() line 143
- new ReferentialAction line 145
- class-const ReferenceRule::OPTIONS() line 145
Private surface 5§
Implementation details, listed for orientation only.
private const MATCHES = ['opt_match_clause:' => null, 'opt_match_clause: MATCH FULL' => \SqlSemantics\P…private const ACTIONS = ['opt_on_update_delete:' => [], 'opt_on_update_delete: ON UPDATE_SYM delete_opt…private const OPTIONS = ['delete_option: RESTRICT' => \SqlSemantics\Platform\MySql\Statement\Table\Key\…private const COLUMNS = ['ref_list: ref_list , ident', 'ref_list: ident', 'reference_list: reference_li…private Lowering $loweringTest cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Relations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Lowering\TableDefinition\ElementRule::element() packages/sql-semantics-mysql/src/Lowering/TableDefinition/ElementRule.php:92
- new SqlSemantics\Platform\MySql\Lowering\TableDefinition\Key\KeyRule::element() packages/sql-semantics-mysql/src/Lowering/TableDefinition/Key/KeyRule.php:69
- new SqlSemantics\Platform\MySql\Lowering\TableDefinition\TableDefinitionRules::columnSpecification() packages/sql-semantics-mysql/src/Lowering/TableDefinition/TableDefinitionRules.php:124
Method calls 4
- method-call SqlSemantics\Platform\MySql\Lowering\TableDefinition\ElementRule::element() packages/sql-semantics-mysql/src/Lowering/TableDefinition/ElementRule.php:97
- method-call SqlSemantics\Platform\MySql\Lowering\TableDefinition\ElementRule::element() packages/sql-semantics-mysql/src/Lowering/TableDefinition/ElementRule.php:100
- method-call SqlSemantics\Platform\MySql\Lowering\TableDefinition\Key\KeyRule::element() packages/sql-semantics-mysql/src/Lowering/TableDefinition/Key/KeyRule.php:76
- method-call SqlSemantics\Platform\MySql\Lowering\TableDefinition\TableDefinitionRules::columnSpecification() packages/sql-semantics-mysql/src/Lowering/TableDefinition/TableDefinitionRules.php:124