classSequenceNumber
final class SequenceNumber
implements SequenceOption
uses Snapshot
Public API: explicitly declared with
@visibility public.A sequence option with a number: CACHE, INCREMENT, MAXVALUE, MINVALUE, START or RESTART.
The optional BY after INCREMENT and WITH after START and RESTART change nothing ("INCREMENT [ BY ] increment", "START [ WITH ] start") and are not kept. Source: https://www.postgresql.org/docs/17/sql-createsequence.html, https://www.postgresql.org/docs/17/sql-altersequence.html.
$create = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE SEQUENCE s START WITH -5');
[$create->statement->options[0]->kind, $create->statement->options[0]->value->negative, $create->toString()] // => [\SqlSemantics\Platform\PostgreSql\Statement\Table\Sequence\SequenceNumberKind::Start, true, 'CREATE SEQUENCE s START - 5']Properties§
public SequenceNumberKind $kindpublic SignedNumber $valueMethods§
public function __construct(public SequenceNumberKind $kind, public SignedNumber $value)Parameters
$kind | SequenceNumberKind | The option |
$value | SignedNumber | The number |
public function deriveClause(Derivation $derivation, Environment $environment): voidDerives nothing: the number is a constant.
Parameters
$derivation | Derivation | |
$environment | Environment |
public function render(Output $out): voidWrites the keyword and the number.
Parameters
$out | Output |
Calls 1
- method-call Output::keyword() line 50
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
SequenceNumberTestcalls