final class BitStringConstant
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

The value of a bit-string constant: its notation and the digits between the quotes.

The scanner accepts any characters between the quotes and the bit input function interprets them later, so the digits are opaque text here; a hexadecimal digit stands for four bits. Source: https://www.postgresql.org/docs/17/sql-syntax-lexical.html#SQL-SYNTAX-BIT-STRINGS.

Reading a hexadecimal bit stringdoctest
$query = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("SELECT X'1F'");
    $value = $query->statement->targets[0]->expression->value;
    [$value->radix, $value->digits] // => [\SqlSemantics\Platform\PostgreSql\Statement\Literal\BitStringRadix::Hexadecimal, '1F']

Properties§

public string $digits

Methods§

public function __construct(public BitStringRadix $radix, public string $digits)

Parameters

$radixBitStringRadixThe notation of the digits
$digitsstringThe text between the quotes
Calls 2
public function render(Output $out): void

Writes the notation prefix and the quoted digits.

Parameters

$outOutput
Test cases 1
Calls 1

Test cases 3§

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 1

Relations§

Instantiated in 2
Type declarations 1