classExplicitTable
final class ExplicitTable
implements Statement, Query, NamedRelation
uses Snapshot
@visibility public.The TABLE statement: every row and column of one table (MySQL 8.0.19 and later).
It is both the query and the occurrence of the table it reads.
Rule: MYSQL-EXPLICIT-TABLE-001. The name resolves like a table reference (MYSQL-TABLE-SHAPES-001); the output fields are the columns of the table in order. Source: https://dev.mysql.com/doc/refman/8.4/en/table.html. Status: Implemented.
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('TABLE shop.t');
[$query->statement->name()->schema?->value, $query->statement->name()->name->value] // => ['shop', 't']Properties§
public QualifiedName $tableMethods§
public function __construct(public QualifiedName $table)Parameters
$table | QualifiedName | The table name with its optional database |
Calls 1
- static-call Check::input() line 46
public function name(): QualifiedNameAnswers the table name.
Returns
public function alias(): ?NameAnswers no correlation name: the TABLE statement takes none.
Returns
?Namepublic function deriveStatement(Derivation $derivation): voidDerives the statement as a statement root and records its rows as the output.
Parameters
$derivation | Derivation |
Calls 3
- method-call Derivation::output() line 70
- method-call Derivation::query() line 70
- method-call Derivation::environment() line 70
public function deriveQuery(Derivation $derivation, Environment $outer): QueryFactResolves the table and answers its columns as the output.
Parameters
$derivation | Derivation | |
$outer | Environment |
Returns
Calls 3
- method-call TableShapes::explicit() line 78
- new TableShapes line 78
- method-call Derivation::relation() line 78
public function deriveRelation(Derivation $derivation, Environment $environment): RelationFactResolves the name and derives the row shape of the occurrence.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 2
- method-call TableShapes::named() line 86
- new TableShapes line 86
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 94
- method-call Output::name() line 96
- class-const NameUse::Qualifier() line 96
- class-const NameUse::Relation() line 98
Test cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.