final class JsonExistsColumn
    implements JsonTableColumn
    uses Snapshot
Public API: explicitly declared with @visibility public.

name type EXISTS [PATH path] [ON ERROR]: a JSON_TABLE column that tells whether the path yields an item.

Mirrors PostgreSQL's JsonTableColumn of type JTC_EXISTS. A column named nested is written quoted: before a type named path gram.y reads the word as the NESTED PATH of a nested column (NESTED has a lower precedence than PATH). Source: https://www.postgresql.org/docs/17/functions-json.html#FUNCTIONS-SQLJSON-TABLE.

Reading an EXISTS columndoctest
$column = new \SqlSemantics\Platform\PostgreSql\Statement\Relation\Json\JsonExistsColumn(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('e'), new \SqlSemantics\Platform\PostgreSql\Statement\Type\TypeName(new \SqlSemantics\Platform\PostgreSql\Statement\Type\Designation\KeywordDesignation(\SqlSemantics\Platform\PostgreSql\Statement\Type\Designation\TypeKeyword::Boolean)));
    $column->path // => null

Properties§

public Name $name
public TypeName $type
public StringConstant|null $path = null
public Clause|null $onError = null

Methods§

public function __construct(
    public Name $name,
    public TypeName $type,
    public StringConstant|null $path = null,
    public Clause|null $onError = null,
)

Parameters

$nameNameThe column name
$typeTypeNameThe column type
$pathStringConstant|nullThe path written after PATH
$onErrorClause|nullThe ON ERROR behavior
public function render(Output $out): void

Writes the column definition.

Parameters

$outOutput
Calls 5

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 1
Type checks 2
Type declarations 1