final class TableInput
    implements NamedRelation
    uses Snapshot
Public API: explicitly declared with @visibility public.

One occurrence of a named table, view or common table as query input.

Rule: SQLITE-TABLE-INPUT-001. The shape and the resolution of the name follow SQLITE-TABLE-SHAPE-001. An index choice restricts how SQLite may read the table and changes no row. Source: https://sqlite.org/lang_select.html#the_from_clause, https://sqlite.org/lang_indexedby.html. Status: Implemented.

Reading a named inputdoctest
$input = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('SELECT a FROM main.t AS x')->singleNamedInput();
    [$input->name()->schema?->value, $input->name()->name->value, $input->alias()?->value] // => ['main', 't', 'x']

Properties§

public Name|null $alias = null
public IndexChoice|null $index = null
public bool $as = true

Methods§

public function __construct(
    public QualifiedName $name,
    public Name|null $alias = null,
    public IndexChoice|null $index = null,
    public bool $as = true,
)

Parameters

$nameQualifiedNameThe relation name
$aliasName|nullThe correlation name
$indexIndexChoice|nullThe demanded index
$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 name(): QualifiedName

Answers the relation name.

public function alias(): ?Name

Answers the correlation name.

Returns

public function deriveRelation(Derivation $derivation, Environment $environment): RelationFact

Resolves the name and derives the row shape of the occurrence.

Parameters

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

Writes the name, the correlation name and the index choice.

Parameters

$outOutput
Calls 6

Test cases 88§

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 84

Relations§

Instantiated in 2
Type checks 1