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

A BLOB literal, kept as the hexadecimal digits of its bytes in upper case.

Rule: SQLITE-BLOB-LITERAL-001. A BLOB literal has storage class BLOB. Source: https://sqlite.org/lang_expr.html#literal_values_constants_. Status: Implemented.

Reading the bytes of a BLOB literaldoctest
$query = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze("SELECT x'0aff' AS b");
    [$query->statement->columns[0]->expression->hex, $query->toString()] // => ['0AFF', "SELECT x'0AFF' AS b"]
Refusing half a bytedoctest
new \SqlSemantics\Platform\Sqlite\Statement\Expression\Literal\BlobLiteral('ABC') // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\InvalidConstruction
Refusing lower case digitsdoctest
new \SqlSemantics\Platform\Sqlite\Statement\Expression\Literal\BlobLiteral('0aff') // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\InvalidConstruction

Properties§

public string $hex

Methods§

public function __construct(public string $hex)

Parameters

$hexstringThe bytes as upper-case hexadecimal digits, two per byte
Calls 2
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives BLOB.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

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

Writes the digits in the BLOB literal quotes.

Parameters

$outOutput
Calls 1

Test cases 4§

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 1

Relations§

Instantiated in 1
Constant reads 1