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

Lowers EXTRACT, OVERLAY, POSITION, SUBSTRING and TRIM with their keyword-separated operands.

Rule: PG-TEXT-LOWERING-001. Scope: the EXTRACT, OVERLAY, POSITION, SUBSTRING and TRIM productions of func_expr_common_subexpr, extract_list, extract_arg, overlay_list, position_list, substr_list, trim_list. Constructors: Extract, Overlay, Position, Substring, SimilarSubstring, Trim, and KeywordCall for SUBSTRING and OVERLAY with plain arguments. BOTH in TRIM, and FROM in TRIM without characters, are the defaults and noise (see InvocationNoise). Termination: lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/functions-string.html, https://www.postgresql.org/docs/17/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe hub
public function expression(Form $form): Scalar

Lowers an EXTRACT, OVERLAY, POSITION, SUBSTRING or TRIM production of func_expr_common_subexpr.

Parameters

$formForm

Returns

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 12
public function extract(Node $list): Extract
public function trim(TrimSide $side, Node $list): Trim

Private surface 3§

Implementation details, listed for orientation only.

private const SIDES = ['func_expr_common_subexpr: TRIM ( BOTH trim_list )' => \SqlSemantics\Platform\…
private const UNITS = ['extract_arg: YEAR_P' => \SqlSemantics\Platform\PostgreSql\Statement\Invocatio…
private Lowering $lowering

Test cases 4§

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

Dedicated tests 4

Relations§

Instantiated in 1
Method calls 1