classFactorRule
final class FactorRule
Lowers the table factors of the 8.0 and later grammars.
Rule: MYSQL-FACTOR-MODERN-001. Scope: table_factor (8.0 and later), single_table_parens, joined_table_parens, table_reference_list_parens, derived_table, table_function. Parentheses around references are nested relations, one pair each; the parentheses a derived table requires belong to it. Constructs: TableReference (through the table parts), NestedRelation, TableList, DerivedTable, JsonTable. Terminates: recursion follows strictly smaller parts; the lists are flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/join.html, https://dev.mysql.com/doc/refman/8.4/en/derived-tables.html, https://dev.mysql.com/doc/refman/8.4/en/json-table-functions.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
Lowers a table factor.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 7
- method-call TableRule::table() line 54
- new TableRule line 54
- method-call Form::node() line 54
- method-call FactorRule::derived() line 55
- method-call FactorRule::function() line 56
- method-call FactorRule::parens() line 57
- static-call ImplementationGap::production() line 58
public function parens(Node $parens): NestedRelationLowers table references in parentheses.
Parameters
$parens | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\FactorRule::factor() packages/sql-semantics-mysql/src/Lowering/Query/Modern/FactorRule.php:57
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\FactorRule::parens() packages/sql-semantics-mysql/src/Lowering/Query/Modern/FactorRule.php:72
Calls 12
- method-call Lowering::form() line 69
- new NestedRelation line 71
- method-call FactorRule::parens() line 72
- method-call TableRule::table() line 73
- new TableRule line 73
- method-call ReferenceRule::joined() line 74
- new ReferenceRule line 74
- new TableList line 75
- method-call FromRule::members() line 75
- new FromRule line 75
- method-call ReferenceRule::reference() line 75
- static-call ImplementationGap::production() line 76
public function derived(Node $derived): DerivedTableLowers a derived table.
Parameters
$derived | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 9
- method-call Lowering::form() line 87
- static-call ImplementationGap::production() line 91
- new TableRule line 94
- new DerivedTable line 96
- method-call ExpressionRule::subquery() line 96
- new ExpressionRule line 96
- method-call TableRule::alias() line 96
- method-call TableRule::columns() line 96
- method-call TableRule::mark() line 96
Lowers a JSON_TABLE table function.
Parameters
$function | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 6
- method-call Lowering::form() line 106
- static-call ImplementationGap::production() line 108
- new JsonTable line 111
- method-call TableRule::alias() line 115
- new TableRule line 115
- method-call TableRule::mark() line 116
Private surface 1§
Implementation details, listed for orientation only.
private Lowering $lowering