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

name type [FORMAT JSON] [PATH path] [wrapper] [quotes] [behavior]: a JSON_TABLE column read from the row.

Mirrors PostgreSQL's JsonTableColumn of type JTC_REGULAR, or JTC_FORMATTED when a FORMAT clause is written. 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 a value columndoctest
$query = (new \SqlSemantics\Platform\PostgreSql\Semantics('pg-17.2'))->analyze("SELECT * FROM JSON_TABLE ('[]', '$[*]' COLUMNS (a integer PATH '$.a'))");
    [$query->statement->from->columns[0]->path->value, $query->field(0)->type->descriptor->name()] // => ['$.a', 'integer']

Properties§

public Name $name
public TypeName $type
public StringConstant|null $path = null
public Clause|null $format = null
public Clause|null $wrapper = null
public Clause|null $quotes = null
public Clause|null $behavior = null

Methods§

public function __construct(
    public Name $name,
    public TypeName $type,
    public StringConstant|null $path = null,
    public Clause|null $format = null,
    public Clause|null $wrapper = null,
    public Clause|null $quotes = null,
    public Clause|null $behavior = null,
)

Parameters

$nameNameThe column name
$typeTypeNameThe column type
$pathStringConstant|nullThe path written after PATH
$formatClause|nullThe FORMAT clause
$wrapperClause|nullThe wrapper behavior
$quotesClause|nullThe quotes behavior
$behaviorClause|nullThe ON EMPTY and ON ERROR behaviors
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 1
Type declarations 2