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

An identifier written as an operand of ATTACH or DETACH, which SQLite reads as a text value.

Rule: SQLITE-ATTACH-NAME-001. The operands of ATTACH and DETACH are expressions, but an operand that is a single identifier, with or without parentheses around it, is not a column reference: SQLite turns it into the string of its name before resolving names, which is what makes ATTACH 'file.db' AS aux work. Facts: TEXT, never NULL, no resolution. Source: https://sqlite.org/lang_attach.html (and resolveAttachExpr() in attach.c of the release). Status: Implemented.

Reading a schema name written as an identifierdoctest
$attach = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze("ATTACH 'file.db' AS aux");
    [$attach->statement->schema->name->value, $attach->facts->scalar($attach->statement->schema)->type->descriptor] // => ['aux', \SqlSemantics\Platform\Sqlite\Statement\Type\Storage::Text]

Properties§

public Name $name

Methods§

public function __construct(public Name $name)

Parameters

$nameNameThe identifier whose name is the text value
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the facts of a text constant.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

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

Writes the identifier.

Parameters

$outOutput
Calls 2

Test cases 7§

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 5

Relations§

Instantiated in 1