classQueryTails
final class QueryTails
Writes what follows the first operand of a set operation and the body of a query expression.
Rule: MYSQL-QUERY-TAIL-001. A set operation and a leading union are written as the left operand, the operator, the written quantifier and the right operand; a query expression as its WITH clause, its body, its ORDER BY and its LIMIT. The parts after the left operand and after the body are written here only, so a writer that has to place something inside the first operand (the 5.x enclosed partitioning of CREATE TABLE … SELECT) writes the rest exactly as the query does. Terminates: the operands are written by their own classes. Source: https://dev.mysql.com/doc/refman/8.4/en/set-operations.html, https://dev.mysql.com/doc/refman/8.4/en/select.html. Status: Implemented.
Methods§
public function operation(SetOperation $operation, Output $out): voidWrites the operator, the quantifier and the right operand of a set operation.
Parameters
$operation | SetOperation | |
$out | Output |
Called from 2
- method-call SqlSemantics\Platform\MySql\Rules\TableDefinition\EnclosedQuery::write() packages/sql-semantics-mysql/src/Rules/TableDefinition/EnclosedQuery.php:65
- method-call SqlSemantics\Platform\MySql\Statement\Query\Set\SetOperation::render() packages/sql-semantics-mysql/src/Statement/Query/Set/SetOperation.php:89
Calls 2
- method-call Output::keyword() line 37
- method-call Output::node() line 41
public function leading(LeadingUnion $leading, Output $out): voidWrites UNION, the quantifier and the last operand of a leading union.
Parameters
$leading | LeadingUnion | |
$out | Output |
Test cases 1
Called from 2
- method-call SqlSemantics\Platform\MySql\Rules\TableDefinition\EnclosedQuery::write() packages/sql-semantics-mysql/src/Rules/TableDefinition/EnclosedQuery.php:68
- method-call SqlSemantics\Platform\MySql\Statement\Query\Set\LeadingUnion::render() packages/sql-semantics-mysql/src/Statement/Query/Set/LeadingUnion.php:71
Calls 3
- method-call Output::keyword() line 49
- class-const SetOperator::Union() line 49
- method-call Output::node() line 53
public function expression(QueryExpression $expression, Output $out): voidWrites the ORDER BY and the LIMIT of a query expression.
Parameters
$expression | QueryExpression | |
$out | Output |
Test cases 1
Called from 2
- method-call SqlSemantics\Platform\MySql\Rules\TableDefinition\EnclosedQuery::write() packages/sql-semantics-mysql/src/Rules/TableDefinition/EnclosedQuery.php:72
- method-call SqlSemantics\Platform\MySql\Statement\Query\QueryExpression::render() packages/sql-semantics-mysql/src/Statement/Query/QueryExpression.php:91
Calls 2
- method-call Output::keyword() line 62
- method-call Output::node() line 64
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Relations§
Instantiated in 6
- new SqlSemantics\Platform\MySql\Rules\TableDefinition\EnclosedQuery::write() packages/sql-semantics-mysql/src/Rules/TableDefinition/EnclosedQuery.php:65
- new SqlSemantics\Platform\MySql\Rules\TableDefinition\EnclosedQuery::write() packages/sql-semantics-mysql/src/Rules/TableDefinition/EnclosedQuery.php:68
- new SqlSemantics\Platform\MySql\Rules\TableDefinition\EnclosedQuery::write() packages/sql-semantics-mysql/src/Rules/TableDefinition/EnclosedQuery.php:72
- new SqlSemantics\Platform\MySql\Statement\Query\QueryExpression::render() packages/sql-semantics-mysql/src/Statement/Query/QueryExpression.php:91
- new SqlSemantics\Platform\MySql\Statement\Query\Set\LeadingUnion::render() packages/sql-semantics-mysql/src/Statement/Query/Set/LeadingUnion.php:71
- new SqlSemantics\Platform\MySql\Statement\Query\Set\SetOperation::render() packages/sql-semantics-mysql/src/Statement/Query/Set/SetOperation.php:89
Method calls 6
- method-call SqlSemantics\Platform\MySql\Rules\TableDefinition\EnclosedQuery::write() packages/sql-semantics-mysql/src/Rules/TableDefinition/EnclosedQuery.php:65
- method-call SqlSemantics\Platform\MySql\Rules\TableDefinition\EnclosedQuery::write() packages/sql-semantics-mysql/src/Rules/TableDefinition/EnclosedQuery.php:68
- method-call SqlSemantics\Platform\MySql\Rules\TableDefinition\EnclosedQuery::write() packages/sql-semantics-mysql/src/Rules/TableDefinition/EnclosedQuery.php:72
- method-call SqlSemantics\Platform\MySql\Statement\Query\QueryExpression::render() packages/sql-semantics-mysql/src/Statement/Query/QueryExpression.php:91
- method-call SqlSemantics\Platform\MySql\Statement\Query\Set\LeadingUnion::render() packages/sql-semantics-mysql/src/Statement/Query/Set/LeadingUnion.php:71
- method-call SqlSemantics\Platform\MySql\Statement\Query\Set\SetOperation::render() packages/sql-semantics-mysql/src/Statement/Query/Set/SetOperation.php:89