classAlterIdentity
final class AlterIdentity
implements AlterCommand
uses Snapshot
Public API: explicitly declared with
@visibility public.ALTER [ COLUMN ] ... SET/RESTART: changes the sequence or the generation of an identity column.
Mirrors AT_SetIdentity with its options in the order written. Source: https://www.postgresql.org/docs/17/sql-altertable.html.
$statement = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER TABLE t ALTER a SET GENERATED BY DEFAULT RESTART WITH 5 SET INCREMENT 2');
$statement->toString() // => 'ALTER TABLE t ALTER a SET GENERATED BY DEFAULT RESTART 5 SET INCREMENT 2'Properties§
public non-empty-list<IdentityRestart|IdentitySetting|IdentityGeneration> $optionspublic Name $columnMethods§
public function __construct(
public Name $column,
list<IdentityRestart|IdentitySetting|IdentityGeneration> $options,
)Parameters
$column | Name | The column |
$options | list<IdentityRestart|IdentitySetting|IdentityGeneration> | The changes in the order written |
Calls 2
- method-call IdentityChanges::checked() line 43
- new IdentityChanges line 43
public function deriveClause(Derivation $derivation, Environment $environment): voidChecks that the column exists.
Parameters
$derivation | Derivation | |
$environment | Environment |
Calls 2
- method-call Alterations::column() line 51
- new Alterations line 51
public function render(Output $out): voidWrites the action.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 59
- method-call Writing::sequence() line 60
- new Writing line 60
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.