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

JSON (value [WITH | WITHOUT UNIQUE KEYS]): a text or byte string parsed as json (PostgreSQL 17).

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

Reading a parse with a uniqueness checkdoctest
$parse = new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Json\Constructor\JsonParse(new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Json\JsonValueExpression(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\NullLiteral()), new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Json\JsonUniqueKeys(true));
    [$parse->unique->unique, $parse->outputName()->value] // => [true, 'json']

Properties§

public JsonUniqueKeys|null $unique = null

Methods§

public function __construct(
    public JsonValueExpression $value,
    public JsonUniqueKeys|null $unique = null,
)

Parameters

$valueJsonValueExpressionThe value parsed
$uniqueJsonUniqueKeys|nullThe uniqueness clause written
Calls 3
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 with the value and the uniqueness clause.

Parameters

$outOutput
Test cases 1
Calls 1

Test cases 4§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 4

Relations§

Instantiated in 1