classNestedInput
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.
$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 $relationpublic Name|null $alias = nullpublic bool $as = trueMethods§
public function __construct(
public Relation $relation,
public Name|null $alias = null,
public bool $as = true,
)Parameters
Throws
InvalidConstruction When AS is left out without an aliasCalls 1
- static-call Check::input() line 45
public function deriveRelation(Derivation $derivation, Environment $environment): RelationFactDerives the relation inside and the shape the parentheses contribute.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 2
- method-call FromScope::enter() line 53
- new FromScope line 53
public function render(Output $out): voidWrites the relation in parentheses and the correlation name.
Parameters
$out | Output |
Calls 4
- method-call Output::symbol() line 61
- method-call Output::keyword() line 64
- method-call Output::name() line 66
- class-const NameUse::Alias() line 66
Test cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.