final class PredicateRule
Restricted visibility: declared "@visibility SqlSemantics\Platform\PostgreSql\Lowering". Code outside that scope must not name this declaration.

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§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe hub
public function range(Form $form): ?Between
public function asymmetric(Node $flag): void

Accepts opt_asymmetric: ASYMMETRIC is the default and requests nothing.

Parameters

$flagNode

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 1
Calls 1
public function tests(Form $form): ?Scalar

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 $lowering

Test cases 6§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 6

Relations§

Instantiated in 1
Method calls 1