classTableFunctionRule
final class TableFunctionRule
Lowers XMLTABLE and JSON_TABLE in FROM.
Rule: PG-TABLE-FUNCTION-LOWER-001. Scope: xmltable, xmltable_column_list, xmltable_column_el, xmltable_column_option_list, xmltable_column_option_el, xml_namespace_list, xml_namespace_el, json_table, json_table_path_name_opt, json_table_column_definition_list, json_table_column_definition, path_opt, json_table_column_path_clause_opt. Constructors: XmlTable, XmlNamespace, XmlTableColumn, XmlColumnOption, JsonTable, JsonOrdinalityColumn, JsonValueColumn, JsonExistsColumn, JsonNestedColumns. The PASSING, FORMAT, wrapper, quotes and behavior clauses are lowered by the invocation family. The PATH word of NESTED is optional. Termination: lists are flattened iteratively; nested columns recurse on the tree depth. Source: https://www.postgresql.org/docs/17/functions-xml.html#FUNCTIONS-XML-PROCESSING-XMLTABLE, https://www.postgresql.org/docs/17/functions-json.html#FUNCTIONS-SQLJSON-TABLE. Status: Implemented.
Methods§
Lowers xmltable with its alias.
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
Calls 4
- static-call ImplementationGap::production() line 70
- method-call TableFunctionRule::namespaces() line 72
- new XmlTable line 74
- method-call TableFunctionRule::xmlColumns() line 77
public function namespaces(Node $list): list<XmlNamespace>Lowers xml_namespace_list.
Parameters
$list | Node |
Returns
list<XmlNamespace>Throws
ImplementationGap When an item has no ruleTest cases 1
Called from 1
Calls 3
- method-call Lowering::items() line 95
- new XmlNamespace line 98
- static-call ImplementationGap::production() line 100
public function xmlColumns(Node $list): list<XmlTableColumn>Lowers xmltable_column_list.
Parameters
$list | Node |
Returns
list<XmlTableColumn>Throws
ImplementationGap When an item has no ruleTest cases 1
Called from 1
Calls 4
- method-call Lowering::items() line 117
- new XmlTableColumn line 121
- method-call TableFunctionRule::options() line 122
- static-call ImplementationGap::production() line 124
public function options(Node $list): list<XmlColumnOption>Lowers xmltable_column_option_list.
Parameters
$list | Node |
Returns
list<XmlColumnOption>Throws
ImplementationGap When an option has no ruleTest cases 1
Called from 1
Calls 8
- method-call Lowering::items() line 141
- new XmlColumnOption line 144
- class-const XmlColumnOptionKind::Named() line 144
- class-const XmlColumnOptionKind::Default() line 145
- class-const XmlColumnOptionKind::Path() line 146
- class-const XmlColumnOptionKind::NotNull() line 147
- class-const XmlColumnOptionKind::Null() line 148
- static-call ImplementationGap::production() line 149
Lowers json_table with its alias.
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
Calls 4
- static-call ImplementationGap::production() line 167
- new JsonTable line 172
- method-call TableFunctionRule::jsonColumns() line 175
- method-call TableFunctionRule::clause() line 182
public function jsonColumns(Node $list): list<JsonTableColumn>Lowers json_table_column_definition_list.
Parameters
$list | Node |
Returns
list<JsonTableColumn>Throws
ImplementationGap When a definition has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\TableFunctionRule::json() packages/sql-semantics-postgres/src/Lowering/Query/TableFunctionRule.php:175
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\TableFunctionRule::nested() packages/sql-semantics-postgres/src/Lowering/Query/TableFunctionRule.php:250
Calls 8
- method-call Lowering::items() line 199
- new JsonOrdinalityColumn line 202
- method-call TableFunctionRule::value() line 203
- method-call TableFunctionRule::clause() line 204
- new JsonExistsColumn line 205
- method-call TableFunctionRule::path() line 208
- method-call TableFunctionRule::nested() line 211
- static-call ImplementationGap::production() line 213
public function value(Form $form, ?Clause $format, int $path): JsonValueColumnLowers a value column whose path clause is at a position.
Returns
Test cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\TableFunctionRule::jsonColumns() packages/sql-semantics-postgres/src/Lowering/Query/TableFunctionRule.php:203
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\TableFunctionRule::jsonColumns() packages/sql-semantics-postgres/src/Lowering/Query/TableFunctionRule.php:204
Calls 4
- new JsonValueColumn line 227
- method-call Form::node() line 228
- method-call TableFunctionRule::path() line 230
- method-call TableFunctionRule::clause() line 232
public function nested(Form $form, int $columns, ?Name $name): JsonNestedColumnsLowers NESTED columns whose column list is at a position.
Returns
Throws
ImplementationGap When `path_opt` has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\TableFunctionRule::jsonColumns() packages/sql-semantics-postgres/src/Lowering/Query/TableFunctionRule.php:211
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\TableFunctionRule::jsonColumns() packages/sql-semantics-postgres/src/Lowering/Query/TableFunctionRule.php:212
Calls 4
- method-call Form::node() line 245
- static-call ImplementationGap::production() line 247
- new JsonNestedColumns line 250
- method-call TableFunctionRule::jsonColumns() line 250
public function path(Node $clause): ?StringConstantLowers json_table_column_path_clause_opt; no clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\TableFunctionRule::jsonColumns() packages/sql-semantics-postgres/src/Lowering/Query/TableFunctionRule.php:208
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\TableFunctionRule::value() packages/sql-semantics-postgres/src/Lowering/Query/TableFunctionRule.php:230
Calls 1
- static-call ImplementationGap::production() line 265
Answers a clause the invocation family lowered, refusing a node that is not a clause.
Returns
Throws
ImplementationGap When the node is not a clauseTest cases 1
Called from 6
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\TableFunctionRule::json() packages/sql-semantics-postgres/src/Lowering/Query/TableFunctionRule.php:182
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\TableFunctionRule::jsonColumns() packages/sql-semantics-postgres/src/Lowering/Query/TableFunctionRule.php:204
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\TableFunctionRule::jsonColumns() packages/sql-semantics-postgres/src/Lowering/Query/TableFunctionRule.php:209
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\TableFunctionRule::value() packages/sql-semantics-postgres/src/Lowering/Query/TableFunctionRule.php:232
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\TableFunctionRule::value() packages/sql-semantics-postgres/src/Lowering/Query/TableFunctionRule.php:233
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\TableFunctionRule::value() packages/sql-semantics-postgres/src/Lowering/Query/TableFunctionRule.php:234
Calls 1
- static-call ImplementationGap::production() line 277
Private surface 1§
Implementation details, listed for orientation only.
private Lowering $loweringTest cases 10§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 10
TableFunctionRuleTest::testClauseRefusesANodeThatIsNoClausecallsTableFunctionRuleTest::testJsonColumnsLowersNestedColumnscallsTableFunctionRuleTest::testJsonLowersTheColumnscallsTableFunctionRuleTest::testNamespacesReadsDefaultcallsTableFunctionRuleTest::testNestedReadsThePathNamecallsTableFunctionRuleTest::testOptionsKeepsTheWrittenOrdercallsTableFunctionRuleTest::testPathIsNullWithoutClausecallsTableFunctionRuleTest::testValueReadsThePathcallsTableFunctionRuleTest::testXmlColumnsReadsOrdinalitycallsTableFunctionRuleTest::testXmlLowersTheNamespacescalls
Relations§
Instantiated in 1
Method calls 4
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\FromRule::reference() packages/sql-semantics-postgres/src/Lowering/Query/FromRule.php:118
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\FromRule::reference() packages/sql-semantics-postgres/src/Lowering/Query/FromRule.php:119
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\FromRule::reference() packages/sql-semantics-postgres/src/Lowering/Query/FromRule.php:120
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Query\FromRule::reference() packages/sql-semantics-postgres/src/Lowering/Query/FromRule.php:121