classJsonValueColumn
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.
$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 $namepublic TypeName $typepublic StringConstant|null $path = nullpublic Clause|null $format = nullpublic Clause|null $wrapper = nullpublic Clause|null $quotes = nullpublic Clause|null $behavior = nullMethods§
public function render(Output $out): voidWrites the column definition.
Parameters
$out | Output |
Calls 5
- method-call Output::name() line 58
- class-const NameUse::Identifier() line 58
- class-const NameUse::Column() line 58
- method-call Output::keyword() line 60
- method-call Output::node() line 62
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
JsonValueColumnTestcalls
Relations§
Instantiated in 1
Type checks 1
Type declarations 2
- type SqlSemantics\Platform\PostgreSql\Lowering\Query\TableFunctionRule packages/sql-semantics-postgres/src/Lowering/Query/TableFunctionRule.php:223
- type SqlSemantics\Platform\PostgreSql\Rules\Resolution\TableFunctionShapes packages/sql-semantics-postgres/src/Rules/Resolution/TableFunctionShapes.php:165