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

A string literal, kept as its decoded text.

Rule: SQLITE-TEXT-LITERAL-001. A string constant in single quotes has storage class TEXT; a quote inside it is written twice. Source: https://sqlite.org/lang_expr.html#literal_values_constants_. Status: Implemented.

Reading the decoded text of a string literaldoctest
$query = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze("SELECT 'it''s'");
    [$query->statement->columns[0]->expression->value, $query->toString()] // => ["it's", "SELECT 'it''s'"]

Properties§

public string $value

Methods§

public function __construct(public string $value)

Parameters

$valuestringThe decoded text
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives TEXT.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

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

Writes the text in single quotes with each quote doubled.

Parameters

$outOutput
Calls 2

Test cases 37§

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 35

Relations§

Instantiated in 1
Constant reads 1
Type checks 2
Type declarations 1