final class NestedInput
    implements Relation
    uses Snapshot
Public API: explicitly declared with @visibility public.

A FROM clause term list written in parentheses and used as one term.

Rule: SQLITE-NESTED-INPUT-001. The terms inside are joined first. Their relations stay visible under their own names; a correlation name on the parentheses names the joined result as well. Around a single term the parentheses and their correlation name replace the correlation name of that term. Source: https://sqlite.org/lang_select.html#the_from_clause. Status: Implemented.

Reading a parenthesised joindoctest
$query = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('SELECT 1 FROM a LEFT JOIN (b JOIN c) AS x');
    [$query->statement->from->steps[0]->relation->alias->value, count($query->statement->from->steps[0]->relation->relation->steps)] // => ['x', 1]

Properties§

public Relation $relation
public Name|null $alias = null
public bool $as = true

Methods§

public function __construct(
    public Relation $relation,
    public Name|null $alias = null,
    public bool $as = true,
)

Parameters

$relationRelationThe relation written inside the parentheses
$aliasName|nullThe correlation name of the parentheses
$asboolWhether the keyword AS introduces the alias; SQLite names a column after the text of an expression, which includes it

Throws

InvalidConstruction When AS is left out without an alias
Calls 1
public function deriveRelation(Derivation $derivation, Environment $environment): RelationFact

Derives the relation inside and the shape the parentheses contribute.

Parameters

$derivationDerivation
$environmentEnvironment
Calls 2
public function render(Output $out): void

Writes the relation in parentheses and the correlation name.

Parameters

$outOutput
Calls 4

Test cases 8§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 4
Other tests reaching this symbol 4

Relations§

Instantiated in 1
Type checks 2
Type declarations 2