final class SequenceAs
    implements SequenceOption
    uses Snapshot
Public API: explicitly declared with @visibility public.

The AS option of a sequence: the data type of its values.

The server accepts smallint, integer and bigint. Source: https://www.postgresql.org/docs/17/sql-createsequence.html.

Reading the data type of a sequencedoctest
$create = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE SEQUENCE s AS smallint');
    $create->statement->options[0]->type->catalogName()->value // => 'int2'

Properties§

Methods§

public function __construct(public TypeDesignation $type)

Parameters

$typeTypeDesignationThe data type
public function deriveClause(Derivation $derivation, Environment $environment): void

Derives the type modifiers.

Parameters

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

Writes AS and the type.

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