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

The literal TRUE or FALSE.

Rule: MYSQL-BOOLEAN-LITERAL-001. Facts: TRUE and FALSE evaluate to the integers 1 and 0, so the type is that of an integer literal, BIGINT; never NULL. Source: https://dev.mysql.com/doc/refman/8.4/en/boolean-literals.html. Status: Implemented.

Reading a boolean literaldoctest
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE a = TRUE');
    $query->statement->where->right->value // => true

Properties§

public bool $value

Methods§

public function __construct(public bool $value)

Parameters

$valueboolWhether the literal is TRUE
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the integer type; a literal is never NULL.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

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

Writes the keyword.

Parameters

$outOutput
Test cases 1
Calls 1

Test cases 9§

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 6

Relations§

Instantiated in 2
Type checks 2