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.

Reading a numeric optiondoctest
$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 SignedNumber $value

Methods§

public function __construct(public SequenceNumberKind $kind, public SignedNumber $value)

Parameters

$kindSequenceNumberKindThe option
$valueSignedNumberThe number
public function deriveClause(Derivation $derivation, Environment $environment): void

Derives nothing: the number is a constant.

Parameters

$derivationDerivation
$environmentEnvironment
public function render(Output $out): void

Writes the keyword and the number.

Parameters

$outOutput
Calls 1

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 1