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

The constant TRUE or FALSE.

Rule: PG-BOOLEAN-001. Facts: boolean, never NULL. Since PostgreSQL 15 the raw parser reads the keyword as a plain boolean constant (A_Const with a Boolean value, makeBoolAConst in gram.y), not as a cast to bool, so the expression gives an unaliased result column no name and the column is named ?column?. Source: https://www.postgresql.org/docs/17/datatype-boolean.html, https://www.postgresql.org/docs/17/sql-select.html#SQL-SELECT-LIST. Status: Implemented.

Reading the name TRUE gives its columndoctest
$query = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SELECT TRUE');
    [$query->statement->targets[0]->expression->value, $query->field(0)->name->value] // => [true, '?column?']

Properties§

public bool $value

Methods§

public function __construct(public bool $value)

Parameters

$valueboolThe truth value
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives boolean, never NULL.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

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

Writes the keyword.

Parameters

$outOutput
Test cases 1
Calls 1

Test cases 21§

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 19

Relations§

Instantiated in 2
Type checks 1