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

INHERIT or NO INHERIT: adds or removes a parent table.

Mirrors AT_AddInherit and AT_DropInherit. The parent is resolved and is the relation fact of its node. Source: https://www.postgresql.org/docs/17/sql-altertable.html.

Removing a parentdoctest
$statement = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER TABLE t NO INHERIT p');
    $statement->statement->commands[0]->remove // => true

Properties§

public ParentTable $parent
public bool $remove = false

Methods§

public function __construct(public ParentTable $parent, public bool $remove = false)

Parameters

$parentParentTableThe parent table
$removeboolWhether the parent is removed (NO INHERIT); added otherwise
public function deriveClause(Derivation $derivation, Environment $environment): void

Resolves the parent.

Parameters

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

Writes the action.

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 2
Type checks 2
Type declarations 1