classJsonBehaviorClause
final class JsonBehaviorClause
implements Clause
uses Snapshot
Public API: explicitly declared with
@visibility public.behavior ON EMPTY and behavior ON ERROR of an SQL/JSON function or JSON_TABLE column.
Source: https://www.postgresql.org/docs/17/functions-json.html#FUNCTIONS-SQLJSON-QUERYING.
$clause = new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Json\Query\JsonBehaviorClause(null, new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Json\Query\JsonBehavior(\SqlSemantics\Platform\PostgreSql\Statement\Invocation\Json\Query\JsonBehaviorKind::Error));
[$clause->onEmpty, $clause->onError->kind->value] // => [null, 'ERROR']new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Json\Query\JsonBehaviorClause(null, null) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstructionProperties§
public JsonBehavior|null $onEmptypublic JsonBehavior|null $onErrorMethods§
public function __construct(
public JsonBehavior|null $onEmpty,
public JsonBehavior|null $onError,
)Parameters
$onEmpty | JsonBehavior|null | The behavior when the path finds nothing |
$onError | JsonBehavior|null | The behavior when an error occurs |
Calls 1
- static-call Check::input() line 36
public function deriveClause(Derivation $derivation, Environment $environment): voidDerives the default expressions.
Parameters
$derivation | Derivation | |
$environment | Environment |
Test cases 1
public function render(Output $out): voidWrites the behaviors with ON EMPTY and ON ERROR.
Parameters
$out | Output |
Test cases 1
Calls 1
- method-call Output::node() line 54
Test cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
Other tests reaching this symbol 3
Relations§
Instantiated in 3
- new SqlSemantics\Platform\PostgreSql\Lowering\Invocation\JsonQueryRule::behaviors() packages/sql-semantics-postgres/src/Lowering/Invocation/JsonQueryRule.php:172
- new SqlSemantics\Platform\PostgreSql\Lowering\Invocation\JsonQueryRule::behaviors() packages/sql-semantics-postgres/src/Lowering/Invocation/JsonQueryRule.php:173
- new SqlSemantics\Platform\PostgreSql\Lowering\Invocation\JsonQueryRule::behaviors() packages/sql-semantics-postgres/src/Lowering/Invocation/JsonQueryRule.php:174
Type checks 1
Type declarations 4
- type SqlSemantics\Platform\PostgreSql\Lowering\Invocation\Invocations packages/sql-semantics-postgres/src/Lowering/Invocation/Invocations.php:204
- type SqlSemantics\Platform\PostgreSql\Lowering\Invocation\JsonQueryRule packages/sql-semantics-postgres/src/Lowering/Invocation/JsonQueryRule.php:166
- type SqlSemantics\Platform\PostgreSql\Rules\Invocation\JsonChecks packages/sql-semantics-postgres/src/Rules/Invocation/JsonChecks.php:85
- type SqlSemantics\Platform\PostgreSql\Statement\Invocation\Json\Query\JsonQueryFunction packages/sql-semantics-postgres/src/Statement/Invocation/Json/Query/JsonQueryFunction.php:70