classSyntaxRule
final class SyntaxRule
Lowers the SQL-syntax functions of func_expr_common_subexpr and routes the textual, XML and JSON ones to their rules.
Rule: PG-SYNTAX-LOWERING-001. Scope: func_expr_common_subexpr. Constructors: ValueFunction (CURRENT_DATE … CURRENT_SCHEMA, SYSTEM_USER), CollationFor, Cast of the expression family with the function spelling, Normalize, Treat, NullIf, Coalesce, MinMax, MergeAction; EXTRACT, OVERLAY, POSITION, SUBSTRING and TRIM go to TextRule, the XML functions to XmlRule, the JSON functions to JsonRule and JsonQueryRule. Termination: constant work per node. Source: https://www.postgresql.org/docs/17/functions.html. Status: Implemented.
Methods§
Lowers func_expr_common_subexpr.
Parameters
$subexpression | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 11
JsonQueryRuleTest::testFunctionLowersTheThreeQueryFunctionscallsJsonRuleTest::testCreationLowersEveryConstructorcallsJsonRuleTest::testCreationLowersThePostgreSql16FormscallsSyntaxRuleTest::testSpecialBuildsTheFunctionSpellingOfCastcallsSyntaxRuleTest::testSpecialLowersTheRemainingFunctionscallsSyntaxRuleTest::testSubexpressionLowersTheBareKeywordFunctionscallsSyntaxRuleTest::testSubexpressionRoutesToTheFamilyRulescallsTextRuleTest::testExpressionLowersTheKeywordCallscallsTextRuleTest::testTrimLowersTheListFormscallsXmlRuleTest::testExpressionLowersEveryXmlFunctioncallsXmlRuleTest::testRootLowersTheVersionAndStandalonecalls
Called from 1
Calls 14
- class-const SyntaxRule::VALUES() line 84
- new ValueFunction line 85
- class-const SyntaxRule::PRECISE() line 87
- function-call
str_starts_withline 93 - method-call XmlRule::expression() line 93
- new XmlRule line 93
- function-call
in_arrayline 94 - method-call JsonQueryRule::function() line 94
- new JsonQueryRule line 94
- method-call JsonRule::creation() line 95
- new JsonRule line 95
- method-call TextRule::expression() line 96
- new TextRule line 96
- method-call SyntaxRule::special() line 97
Lowers the remaining SQL-syntax functions.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 13
- new CollationFor line 111
- method-call Form::node() line 111
- new Cast line 112
- class-const CastSpelling::Function() line 112
- new Treat line 113
- new Normalize line 114
- new NullIf line 116
- new Coalesce line 117
- new MinMax line 118
- class-const MinMaxKind::Greatest() line 118
- class-const MinMaxKind::Least() line 119
- new MergeAction line 120
- static-call ImplementationGap::production() line 121
Private surface 3§
Implementation details, listed for orientation only.
private const VALUES = ['func_expr_common_subexpr: CURRENT_DATE' => \SqlSemantics\Platform\PostgreSql\…private const PRECISE = ['func_expr_common_subexpr: CURRENT_TIME ( Iconst )' => \SqlSemantics\Platform\…private Lowering $loweringTest cases 11§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
Other tests reaching this symbol 7
JsonQueryRuleTest::testFunctionLowersTheThreeQueryFunctionscallsJsonRuleTest::testCreationLowersEveryConstructorcallsJsonRuleTest::testCreationLowersThePostgreSql16FormscallsTextRuleTest::testExpressionLowersTheKeywordCallscallsTextRuleTest::testTrimLowersTheListFormscallsXmlRuleTest::testExpressionLowersEveryXmlFunctioncallsXmlRuleTest::testRootLowersTheVersionAndStandalonecalls