classJsonScalar
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.
(new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Json\Constructor\JsonScalar(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\NullLiteral()))->outputName()->value // => 'json_scalar'Properties§
public Scalar $valueMethods§
public function __construct(public Scalar $value)Parameters
$value | Scalar | The SQL value |
public function outputName(): NameNames an unaliased result column.
Returns
Test cases 1
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the value, the type and the NULL fact.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 5
- method-call Derivation::scalar() line 56
- new ScalarFact line 58
- new Known line 58
- class-const Builtin::Json() line 58
- class-const Nullability::Nullable() line 58
public function render(Output $out): voidWrites JSON_SCALAR with the value.
Parameters
$out | Output |
Test cases 1
Calls 1
- method-call Output::keyword() line 66
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.