final class JsonChecks
Restricted visibility: declared "@visibility SqlSemantics\Platform\PostgreSql". Code outside that scope must not name this declaration.

Reports the SQL/JSON expressions the server rejects while analyzing them.

Rule: PG-JSON-CHECKS-001. An ENCODING is allowed only on a bytea value (a string constant or NULL is text there). JSON_QUERY accepts ERROR, NULL, EMPTY [ARRAY], EMPTY OBJECT and DEFAULT on empty and on error, and OMIT QUOTES only without a wrapper; JSON_EXISTS accepts ERROR, TRUE, FALSE and UNKNOWN on error; JSON_VALUE accepts ERROR, NULL and DEFAULT; FORMAT JSON in RETURNING is meaningful for JSON_QUERY only. The same behavior rules apply to the columns of JSON_TABLE, named in the message. Source: https://www.postgresql.org/docs/17/functions-json.html#FUNCTIONS-SQLJSON-QUERYING, transformJsonFuncExpr and transformJsonValueExpr in src/backend/parser/parse_expr.c of PostgreSQL 17. Termination: constant work. Status: Implemented.

Methods§

public function input(
    Derivation $derivation,
    JsonValueExpression $value,
    ScalarFact $fact,
    bool $parsed = false,
): void

Reports an ENCODING written on a value that is not bytea.

Parameters

$derivationDerivation
$valueJsonValueExpression
$factScalarFact
$parsedboolWhether the value is parsed as a context item or by JSON(), which words the problem differently
Test cases 1
Called from 1
Calls 5
public function accepted(JsonFunctionKind $kind, JsonBehaviorKind $behavior): bool

Private surface 1§

Implementation details, listed for orientation only.

private const ACCEPTED = ['JSON_QUERY' => ['ERROR', 'NULL', 'EMPTY', 'EMPTY ARRAY', 'EMPTY OBJECT', 'DEF…

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 3
Method calls 3