final class StringConstant
    implements OptionArgument
    uses Snapshot
Public API: explicitly declared with @visibility public.

The value of a string constant, whichever way it was quoted.

'...', E'...', U&'...' and dollar quoting are spellings of the same thing: the decoded text. Segments continued on a following line are one value. The value is written back as a plain quoted constant. Source: https://www.postgresql.org/docs/17/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS.

Reading the value of an escape stringdoctest
$query = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("SELECT E'a\\tb'");
    $query->statement->targets[0]->expression->value->value // => "a\tb"
Rejecting a value the server cannot holddoctest
new \SqlSemantics\Platform\PostgreSql\Statement\Literal\StringConstant("a\0b") // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstruction

Properties§

public string $value

Methods§

public function __construct(public string $value)

Parameters

$valuestringThe decoded text
Calls 2
public function deriveClause(Derivation $derivation, Environment $environment): void

Derives nothing: a constant holds no expression.

Parameters

$derivationDerivation
$environmentEnvironment
Test cases 1
public function render(Output $out): void

Writes the value as a quoted constant.

Parameters

$outOutput
Test cases 1
Calls 3

Test cases 143§

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

Dedicated tests 3
Other tests reaching this symbol 140

Relations§

Instantiated in 1
Constant reads 3
Type checks 24
Type declarations 72