final class DetachPartition
    implements AlterCommand
    uses Snapshot
Public API: explicitly declared with @visibility public.

DETACH PARTITION: makes a partition a stand-alone table.

Mirrors AT_DetachPartition (concurrent) and AT_DetachPartitionFinalize. The partition is resolved and is the relation fact of its node. Source: https://www.postgresql.org/docs/17/sql-altertable.html.

Finalizing a detachdoctest
$statement = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER TABLE p DETACH PARTITION p1 FINALIZE');
    $statement->statement->commands[0]->mode // => \SqlSemantics\Platform\PostgreSql\Statement\Table\Partition\DetachMode::Finalize

Properties§

public ParentTable $partition
public DetachMode $mode = DetachMode::Plain

Methods§

public function __construct(
    public ParentTable $partition,
    public DetachMode $mode = DetachMode::Plain,
)

Parameters

$partitionParentTableThe partition
$modeDetachModeHow the partition is detached
Calls 1
public function deriveClause(Derivation $derivation, Environment $environment): void

Resolves the partition.

Parameters

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

Writes the action.

Parameters

$outOutput
Calls 2

Test cases 2§

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

Dedicated tests 1
Other tests reaching this symbol 1

Relations§

Instantiated in 2
Type checks 2