classExpressionFacts
final class ExpressionFacts
Derives the facts of a query expression.
Rule: MYSQL-QUERY-EXPRESSION-FACTS-001. The WITH clause binds its common tables (MYSQL-WITH-001) for the body, the ordering and the limit. The ORDER BY items see the output columns of the body by name and position (MYSQL-SORT-SCOPE-001) and, beyond them, the enclosing queries; they see no table of the body. The output is that of the body. Terminates: the body is a strict part. Source: https://dev.mysql.com/doc/refman/8.4/en/union.html ("ORDER BY ... cannot use column references that include a table name"), https://dev.mysql.com/doc/refman/8.4/en/with.html. Status: Implemented.
Methods§
public function derive(
QueryExpression $expression,
Derivation $derivation,
Environment $outer,
): QueryFactDerives every part and answers the output of the body.
Parameters
$expression | QueryExpression | |
$derivation | Derivation | |
$outer | Environment |
Returns
Called from 1
Calls 2
- method-call Derivation::query() line 37
- method-call ExpressionFacts::ordering() line 38
public function ordering(
QueryFact $fact,
list<OrderItem> $orderBy,
?Limit $limit,
Derivation $derivation,
Environment $environment,
): voidDerives an ORDER BY and a LIMIT that apply to the rows of a query in an environment.
Parameters
$fact | QueryFact | |
$orderBy | list<OrderItem> | |
$limit | ?Limit | |
$derivation | Derivation | |
$environment | Environment |
Called from 2
- method-call SqlSemantics\Platform\MySql\Rules\Query\ExpressionFacts::derive() packages/sql-semantics-mysql/src/Rules/Query/ExpressionFacts.php:38
- method-call SqlSemantics\Platform\MySql\Statement\Query\Set\OrderedSetOperation::deriveQuery() packages/sql-semantics-mysql/src/Statement/Query/Set/OrderedSetOperation.php:95
Calls 5
- new Environment line 56
- method-call SortScopes::derive() line 57
- new SortScopes line 57
- method-call TailFacts::limit() line 58
- new TailFacts line 58
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ExpressionFactsTestcalls
Relations§
Instantiated in 2
- new SqlSemantics\Platform\MySql\Statement\Query\QueryExpression::deriveQuery() packages/sql-semantics-mysql/src/Statement/Query/QueryExpression.php:82
- new SqlSemantics\Platform\MySql\Statement\Query\Set\OrderedSetOperation::deriveQuery() packages/sql-semantics-mysql/src/Statement/Query/Set/OrderedSetOperation.php:95
Method calls 2
- method-call SqlSemantics\Platform\MySql\Statement\Query\QueryExpression::deriveQuery() packages/sql-semantics-mysql/src/Statement/Query/QueryExpression.php:82
- method-call SqlSemantics\Platform\MySql\Statement\Query\Set\OrderedSetOperation::deriveQuery() packages/sql-semantics-mysql/src/Statement/Query/Set/OrderedSetOperation.php:95