classSequenceRule
final class SequenceRule
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.
Lowers sequence options.
Rule: PG-SEQUENCE-OPTION-LOWER-001. Scope: OptSeqOptList, OptParenthesizedSeqOptList, SeqOptList, SeqOptElem, opt_by. The optional BY of INCREMENT and WITH of START and RESTART are noise (TableNoise, LeafNoise). Termination: lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/sql-createsequence.html. Status: Implemented.
Methods§
public function create(Node $statement): CreateSequenceLowers CreateSeqStmt.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 5
- static-call ImplementationGap::production() line 73
- new CreateSequence line 76
- method-call SequenceRule::optional() line 78
- method-call CreateTableRule::persistence() line 79
- new CreateTableRule line 79
public function alter(Node $statement): AlterSequenceLowers AlterSeqStmt.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 3
- static-call ImplementationGap::production() line 95
- new AlterSequence line 98
- method-call SequenceRule::options() line 98
public function parenthesized(Node $clause): list<SequenceOption>Lowers OptParenthesizedSeqOptList.
Parameters
$clause | Node |
Returns
list<SequenceOption>Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::column() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:154
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule::constraint() packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:258
Calls 2
- method-call SequenceRule::options() line 113
- static-call ImplementationGap::production() line 115
public function optional(Node $clause): list<SequenceOption>Lowers OptSeqOptList.
Parameters
$clause | Node |
Returns
list<SequenceOption>Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 2
- method-call SequenceRule::options() line 131
- static-call ImplementationGap::production() line 133
public function options(Node $list): list<SequenceOption>Lowers SeqOptList.
Parameters
$list | Node |
Returns
list<SequenceOption>Test cases 1
Called from 3
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\SequenceRule::alter() packages/sql-semantics-postgres/src/Lowering/Table/SequenceRule.php:98
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\SequenceRule::parenthesized() packages/sql-semantics-postgres/src/Lowering/Table/SequenceRule.php:113
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\SequenceRule::optional() packages/sql-semantics-postgres/src/Lowering/Table/SequenceRule.php:131
Calls 2
- method-call Lowering::items() line 145
- method-call SequenceRule::option() line 146
public function option(Node $option): SequenceOptionLowers SeqOptElem.
Parameters
$option | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::identity() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:330
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\SequenceRule::options() packages/sql-semantics-postgres/src/Lowering/Table/SequenceRule.php:146
Calls 9
- class-const SequenceRule::FLAGS() line 160
- new SequenceFlag line 161
- class-const SequenceRule::NUMBERS() line 163
- class-const SequenceNumberKind::Increment() line 165
- method-call SequenceRule::noise() line 166
- new SequenceNumber line 169
- new SequenceAs line 173
- new SequenceReference line 174
- static-call ImplementationGap::production() line 176
public function noise(Node $words, string ...$signatures): voidChecks a production that only writes noise words: it must be one of the given ones.
Parameters
$words | Node | |
$signatures | string |
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 2
- function-call
in_arrayline 188 - static-call ImplementationGap::production() line 189
Private surface 3§
Implementation details, listed for orientation only.
private const FLAGS = ['SeqOptElem: CYCLE' => \SqlSemantics\Platform\PostgreSql\Statement\Table\Seque…private const NUMBERS = ['SeqOptElem: CACHE NumericOnly' => [\SqlSemantics\Platform\PostgreSql\Statemen…private Lowering $loweringTest cases 7§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 7
SequenceRuleTest::testAlterLowersIfExistscallsSequenceRuleTest::testCreateLowersTheOptionscallsSequenceRuleTest::testNoiseRefusesAnotherProductioncallsSequenceRuleTest::testOptionalIsEmptyWithoutOptionscallsSequenceRuleTest::testOptionLowersAsATypecallsSequenceRuleTest::testOptionsKeepsTheOrdercallsSequenceRuleTest::testParenthesizedIsEmptyWithoutParenthesescalls
Relations§
Instantiated in 5
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::column() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:154
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::identity() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:330
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule::constraint() packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:258
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\Tables::other() packages/sql-semantics-postgres/src/Lowering/Table/Tables.php:70
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\Tables::other() packages/sql-semantics-postgres/src/Lowering/Table/Tables.php:71
Method calls 5
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::column() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:154
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::identity() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:330
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule::constraint() packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:258
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\Tables::other() packages/sql-semantics-postgres/src/Lowering/Table/Tables.php:70
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\Tables::other() packages/sql-semantics-postgres/src/Lowering/Table/Tables.php:71