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

JSON_SCALAR (value): an SQL scalar as a JSON scalar (PostgreSQL 17).

Mirrors PostgreSQL's JsonScalarExpr. Rule: PG-JSON-SCALAR-001. Facts: json, NULL exactly when the value is. The result column is named json_scalar. Source: https://www.postgresql.org/docs/17/functions-json.html#FUNCTIONS-JSON-CREATION-TABLE. Status: Implemented.

Naming the result columndoctest
(new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Json\Constructor\JsonScalar(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\NullLiteral()))->outputName()->value // => 'json_scalar'

Properties§

public Scalar $value

Methods§

public function __construct(public Scalar $value)

Parameters

$valueScalarThe SQL value
public function outputName(): Name

Names an unaliased result column.

Returns

Test cases 1
Calls 1
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the value, the type and the NULL fact.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

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

Writes JSON_SCALAR with the value.

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 3

Relations§

Instantiated in 1