classCursorRule
final class CursorRule
Lowers DECLARE, FETCH, MOVE and CLOSE.
Rule: PG-CURSOR-LOWER-001. Scope: DeclareCursorStmt, cursor_options, opt_hold, FetchStmt, fetch_args, from_in, opt_from_in, ClosePortalStmt. Constructors: DeclareCursor with CursorOption and Holdability, Fetch with FetchMovement, Close. FROM and IN before the cursor name are noise words. Termination: the option list is walked down its spine in a loop. Source: https://www.postgresql.org/docs/17/sql-declare.html, https://www.postgresql.org/docs/17/sql-fetch.html, https://www.postgresql.org/docs/17/sql-close.html. Status: Implemented.
Methods§
public function declare(Node $statement): DeclareCursorLowers DeclareCursorStmt.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 7
- static-call ImplementationGap::production() line 82
- class-const Holdability::With() line 86
- class-const Holdability::Without() line 87
- new DeclareCursor line 92
- method-call ChangeRule::cursor() line 92
- new ChangeRule line 92
- method-call CursorRule::options() line 92
public function options(Node $options): list<CursorOption>Lowers cursor_options.
Parameters
$options | Node |
Returns
list<CursorOption>Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 3
- class-const CursorRule::OPTIONS() line 106
- static-call ImplementationGap::production() line 106
- function-call
array_reverseline 109
Lowers FetchStmt.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 6
- static-call ImplementationGap::production() line 123
- class-const CursorRule::MOVEMENTS() line 126
- method-call CursorRule::from() line 128
- new Fetch line 131
- method-call ChangeRule::cursor() line 135
- new ChangeRule line 135
public function from(Node $words): voidAccepts from_in or opt_from_in: noise words that request nothing.
Parameters
$words | Node |
Throws
ImplementationGap When the production has no ruleCalled from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\CursorRule::fetch() packages/sql-semantics-postgres/src/Lowering/Manipulation/CursorRule.php:128
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\CursorRule::from() packages/sql-semantics-postgres/src/Lowering/Manipulation/CursorRule.php:148
Calls 2
- method-call CursorRule::from() line 148
- static-call ImplementationGap::production() line 150
Lowers ClosePortalStmt.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 4
- new Close line 164
- method-call ChangeRule::cursor() line 164
- new ChangeRule line 164
- static-call ImplementationGap::production() line 166
Private surface 3§
Implementation details, listed for orientation only.
private const OPTIONS = ['cursor_options: cursor_options NO SCROLL' => \SqlSemantics\Platform\PostgreSq…private const MOVEMENTS = ['fetch_args: cursor_name' => [\SqlSemantics\Platform\PostgreSql\Statement\Mani…private Lowering $loweringTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
CursorRuleTestcalls
Relations§
Instantiated in 3
- new SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\Manipulations::statement() packages/sql-semantics-postgres/src/Lowering/Manipulation/Manipulations.php:48
- new SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\Manipulations::statement() packages/sql-semantics-postgres/src/Lowering/Manipulation/Manipulations.php:49
- new SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\Manipulations::statement() packages/sql-semantics-postgres/src/Lowering/Manipulation/Manipulations.php:50
Method calls 3
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\Manipulations::statement() packages/sql-semantics-postgres/src/Lowering/Manipulation/Manipulations.php:48
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\Manipulations::statement() packages/sql-semantics-postgres/src/Lowering/Manipulation/Manipulations.php:49
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\Manipulations::statement() packages/sql-semantics-postgres/src/Lowering/Manipulation/Manipulations.php:50