final class ColumnUse
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

A name used as a value: a request to resolve it as a column at its position.

The node holds the decoded name and qualifier only. Which occurrence and declaration it denotes is a fact of the operation that contains it. A name written bare, in brackets or in backticks is always this request; a word in double quotes and the bare words TRUE and FALSE are other requests.

Rule: SQLITE-COLUMN-USE-001. Facts: the resolution of SQLITE-COLUMN-LOOKUP-001 and the facts of SQLITE-COLUMN-FACT-001. Source: https://sqlite.org/lang_expr.html#column_names. Status: Implemented.

Reading a qualified column usedoctest
$query = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('SELECT t.a FROM t');
    [$query->statement->columns[0]->expression->qualifier?->name->value, $query->statement->columns[0]->expression->name->value] // => ['t', 'a']

Properties§

public Name $name
public QualifiedName|null $qualifier = null

Methods§

public function __construct(public Name $name, public QualifiedName|null $qualifier = null)

Parameters

$nameNameThe column name
$qualifierQualifiedName|nullThe relation the use is qualified with, with its optional schema
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Resolves the name in the environment and derives its facts from the outcome.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 4
public function render(Output $out): void

Writes the qualifier parts and the name.

Parameters

$outOutput
Calls 3

Test cases 53§

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

Dedicated tests 2
Other tests reaching this symbol 51

Relations§

Instantiated in 2
Type checks 14
Type declarations 2