classBlobLiteral
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.
$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"]new \SqlSemantics\Platform\Sqlite\Statement\Expression\Literal\BlobLiteral('ABC') // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\InvalidConstructionnew \SqlSemantics\Platform\Sqlite\Statement\Expression\Literal\BlobLiteral('0aff') // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\InvalidConstructionProperties§
public string $hexMethods§
public function __construct(public string $hex)Parameters
$hex | string | The bytes as upper-case hexadecimal digits, two per byte |
Calls 2
- static-call Check::input() line 43
- function-call
preg_matchline 43
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives BLOB.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 4
- new ScalarFact line 51
- new Known line 51
- class-const Storage::Blob() line 51
- class-const Nullability::NotNull() line 51
public function render(Output $out): voidWrites the digits in the BLOB literal quotes.
Parameters
$out | Output |
Calls 1
- method-call Output::spelled() line 59
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.