classSequences
final class Sequences
Derives CREATE SEQUENCE and the options of a sequence.
Rule: PG-SEQUENCE-001. A sequence is a relation that can be read: "the
- sequence's last_value, log_cnt and is_called" are its columns (bigint,
bigint, boolean), never NULL, with the system columns. A temporary sequence with an unqualified name belongs to pg_temp; inside CREATE SCHEMA an unqualified sequence belongs to that schema. SEQUENCE NAME is accepted only for the sequence of an identity column and is reported in CREATE and ALTER SEQUENCE ("invalid sequence option SEQUENCE NAME"). Source: https://www.postgresql.org/docs/17/sql-createsequence.html. Status: Implemented.
Methods§
public function create(CreateSequence $sequence, Derivation $derivation, ?Name $schema): voidDerives the options and provides the declaration; $schema is the schema of an enclosing CREATE SCHEMA.
Parameters
$sequence | CreateSequence | |
$derivation | Derivation | |
$schema | ?Name |
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Sequence\CreateSequence::deriveStatement() packages/sql-semantics-postgres/src/Statement/Table/Sequence/CreateSequence.php:69
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Sequence\CreateSequence::deriveElement() packages/sql-semantics-postgres/src/Statement/Table/Sequence/CreateSequence.php:77
Calls 15
- method-call Sequences::options() line 42
- new Column line 44
- new Name line 44
- class-const Builtin::Int8() line 44
- class-const Nullability::NotNull() line 44
- class-const Builtin::Bool() line 46
- method-call CreationSchemas::check() line 48
- new CreationSchemas line 48
- method-call QueryTables::name() line 49
- new QueryTables line 49
- method-call Derivation::declare() line 50
- new Table line 50
- method-call SystemColumns::implicit() line 50
- new SystemColumns line 50
- class-const RelationKind::Sequence() line 50
public function options(list<SequenceOption> $options, Derivation $derivation): voidDerives the options of CREATE or ALTER SEQUENCE and reports SEQUENCE NAME.
Parameters
$options | list<SequenceOption> | |
$derivation | Derivation |
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Sequences::create() packages/sql-semantics-postgres/src/Rules/Table/Definition/Sequences.php:42
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Sequence\AlterSequence::deriveStatement() packages/sql-semantics-postgres/src/Statement/Table/Sequence/AlterSequence.php:66
Calls 5
- method-call Derivation::environment() line 61
- method-call Derivation::report() line 63
- new DefinitionProblem line 63
- class-const DefinitionRule::InvalidSequenceOption() line 63
- new Name line 63
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
SequencesTestcalls
Relations§
Instantiated in 3
- new SqlSemantics\Platform\PostgreSql\Statement\Table\Sequence\AlterSequence::deriveStatement() packages/sql-semantics-postgres/src/Statement/Table/Sequence/AlterSequence.php:66
- new SqlSemantics\Platform\PostgreSql\Statement\Table\Sequence\CreateSequence::deriveStatement() packages/sql-semantics-postgres/src/Statement/Table/Sequence/CreateSequence.php:69
- new SqlSemantics\Platform\PostgreSql\Statement\Table\Sequence\CreateSequence::deriveElement() packages/sql-semantics-postgres/src/Statement/Table/Sequence/CreateSequence.php:77
Method calls 3
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Sequence\AlterSequence::deriveStatement() packages/sql-semantics-postgres/src/Statement/Table/Sequence/AlterSequence.php:66
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Sequence\CreateSequence::deriveStatement() packages/sql-semantics-postgres/src/Statement/Table/Sequence/CreateSequence.php:69
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Sequence\CreateSequence::deriveElement() packages/sql-semantics-postgres/src/Statement/Table/Sequence/CreateSequence.php:77