classPredicateRule
final class PredicateRule
Lowers the predicate productions of a_expr.
Rule: PG-EXPRESSION-PREDICATE-001. Scope: LIKE, ILIKE and SIMILAR TO with and without NOT and ESCAPE; IS [NOT] NULL, ISNULL, NOTNULL; IS [NOT] TRUE, FALSE, UNKNOWN; [NOT] BETWEEN [ASYMMETRIC|SYMMETRIC]; IS [NOT] [form] NORMALIZED; IS [NOT] JSON; OVERLAPS; DEFAULT; and, through PG-EXPRESSION-SUBLINK-001, IN, the quantified comparisons and UNIQUE. Also opt_asymmetric and json_predicate_type_constraint. Constructors: PatternMatch, NullTest, BooleanTest, Between, NormalizationTest, JsonTest, Overlaps, DefaultRequest. Termination: each operand is a strictly smaller subtree. Source: https://www.postgresql.org/docs/17/functions-comparison.html, https://www.postgresql.org/docs/17/functions-matching.html. Status: Implemented.
Methods§
Lowers a predicate production, or answers null when the production is not one.
Parameters
$form | Form |
Returns
Test cases 2
Called from 1
Calls 11
- class-const PredicateRule::PATTERNS() line 110
- new PatternMatch line 114
- method-call Form::node() line 115
- class-const PredicateRule::TRUTH() line 122
- new BooleanTest line 124
- class-const PredicateRule::NULLS() line 126
- new NullTest line 128
- method-call PredicateRule::range() line 131
- method-call PredicateRule::tests() line 131
- method-call SublinkRule::lower() line 131
- new SublinkRule line 131
Lowers a range test, or answers null when the production is not one.
Parameters
$form | Form |
Returns
Test cases 1
Called from 1
Calls 4
- class-const PredicateRule::RANGES() line 139
- method-call PredicateRule::asymmetric() line 145
- method-call Form::node() line 145
- new Between line 149
public function asymmetric(Node $flag): voidAccepts opt_asymmetric: ASYMMETRIC is the default and requests nothing.
Parameters
$flag | Node |
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 1
- static-call ImplementationGap::production() line 161
Lowers the NORMALIZED, JSON, OVERLAPS and DEFAULT productions, or answers null.
Parameters
$form | Form |
Returns
Test cases 1
Called from 1
Calls 5
- new NormalizationTest line 173
- method-call Form::node() line 173
- method-call PredicateRule::json() line 177
- new Overlaps line 179
- new DefaultRequest line 180
Lowers an IS JSON predicate.
Parameters
$form | Form | |
$negated | bool |
Returns
Throws
ImplementationGap When the item kind has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Expression\PredicateRule::tests() packages/sql-semantics-postgres/src/Lowering/Expression/PredicateRule.php:177
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Expression\PredicateRule::tests() packages/sql-semantics-postgres/src/Lowering/Expression/PredicateRule.php:178
Calls 4
- method-call Form::node() line 193
- class-const PredicateRule::JSON() line 194
- static-call ImplementationGap::production() line 194
- new JsonTest line 197
Private surface 6§
Implementation details, listed for orientation only.
private const PATTERNS = ['a_expr: a_expr LIKE a_expr' => [\SqlSemantics\Platform\PostgreSql\Statement\E…private const TRUTH = ['a_expr: a_expr IS TRUE_P' => \SqlSemantics\Platform\PostgreSql\Statement\Expr…private const NULLS = ['a_expr: a_expr IS NULL_P' => [false, \SqlSemantics\Platform\PostgreSql\Statem…private const RANGES = ['a_expr: a_expr BETWEEN opt_asymmetric b_expr AND a_expr' => [false, false, 3]…private const JSON = ['json_predicate_type_constraint: JSON' => \SqlSemantics\Platform\PostgreSql\St…private Lowering $loweringTest cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
PredicateRuleTest::testAsymmetricAcceptsTheEmptyProductioncallsPredicateRuleTest::testJsonLowersTheItemKindcallsPredicateRuleTest::testLowerLowersAPatternWithAnEscapecallsPredicateRuleTest::testLowerLowersAPostfixNullTestcallsPredicateRuleTest::testRangeDropsAsymmetriccallsPredicateRuleTest::testTestsLowersDefaultcalls