classRelationList
final class RelationList
implements Relation
uses Snapshot
Public API: explicitly declared with
@visibility public.Several FROM items separated by commas: their cross product.
Mirrors the fromClause list of PostgreSQL's SelectStmt when it holds more than one item; one item is kept as the item itself. Each item may be referred to by the LATERAL items after it. The facts follow PG-FROM-SCOPE-001. Source: https://www.postgresql.org/docs/17/queries-table-expressions.html#QUERIES-FROM. Status: Implemented.
$query = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SELECT 1 FROM a, b AS c');
[count($query->statement->from->items), $query->toString()] // => [2, 'SELECT 1 FROM a, b AS c']new \SqlSemantics\Platform\PostgreSql\Statement\Relation\RelationList([new \SqlSemantics\Platform\PostgreSql\Statement\Relation\TableInput(new \SqlSemantics\Platform\PostgreSql\Statement\Name\RelationReference(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\QualifiedName(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('t'))))]) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstructionProperties§
public non-empty-list<Relation> $itemsMethods§
public function __construct(list<Relation> $items)Parameters
$items | list<Relation> | The FROM items in written order; at least two |
Calls 3
- static-call Check::listOf() line 45
- class-const Relation::class() line 45
- static-call Check::input() line 47
public function deriveRelation(Derivation $derivation, Environment $environment): RelationFactDerives every item and the combined columns.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 2
- method-call FromScope::enter() line 56
- new FromScope line 56
public function render(Output $out): voidWrites the items separated by commas.
Parameters
$out | Output |
Calls 1
- method-call Output::list() line 64
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
RelationListTestcalls
Other tests reaching this symbol 3
Relations§
Instantiated in 1
Type checks 5
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Query\Locking::tables() packages/sql-semantics-postgres/src/Rules/Query/Locking.php:157
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Query\Trailing::relation() packages/sql-semantics-postgres/src/Rules/Query/Trailing.php:131
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Resolution\FromScope::open() packages/sql-semantics-postgres/src/Rules/Resolution/FromScope.php:55
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Resolution\FromScope::enter() packages/sql-semantics-postgres/src/Rules/Resolution/FromScope.php:94
- instanceof SqlSemantics\Platform\PostgreSql\Statement\Relation\Join::__construct() packages/sql-semantics-postgres/src/Statement/Relation/Join.php:53