classPosition
final class Position
implements Scalar, OutputNaming
uses Snapshot
Public API: explicitly declared with
@visibility public.POSITION (substring IN string): where a substring first occurs.
The server calls pg_catalog.position(string, substring), the operands swapped. Both operands are restricted expressions (b_expr): an operand that would need parentheses there is rejected. Rule: PG-POSITION-001. Facts: those of the call (PG-CALL-RESULT-001; integer). The result column is named position. Source: https://www.postgresql.org/docs/17/functions-string.html. Status: Implemented.
$position = new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Text\Position(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\NullLiteral(), new \SqlSemantics\Platform\PostgreSql\Statement\Literal\NullLiteral());
$position->outputName()->value // => 'position'Properties§
public Scalar $substringpublic Scalar $stringMethods§
public function __construct(public Scalar $substring, public Scalar $string)Parameters
$substring | Scalar | The substring searched for |
$string | Scalar | The string searched |
Calls 3
- new Precedence line 44
- static-call Check::input() line 45
- method-call Precedence::restricted() line 45
public function outputName(): NameNames an unaliased result column after the function the server calls.
Returns
Test cases 1
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the operands and the result of pg_catalog.position.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 3
- method-call Derivation::scalar() line 61
- method-call CallTyping::catalog() line 64
- new CallTyping line 64
public function render(Output $out): voidWrites POSITION with the substring and the string.
Parameters
$out | Output |
Test cases 1
Calls 1
- method-call Output::keyword() line 72
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.