classInheritanceChange
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.
$statement = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER TABLE t NO INHERIT p');
$statement->statement->commands[0]->remove // => trueProperties§
public ParentTable $parentpublic bool $remove = falseMethods§
public function __construct(public ParentTable $parent, public bool $remove = false)Parameters
$parent | ParentTable | The parent table |
$remove | bool | Whether the parent is removed (NO INHERIT); added otherwise |
public function deriveClause(Derivation $derivation, Environment $environment): voidResolves the parent.
Parameters
$derivation | Derivation | |
$environment | Environment |
Calls 3
- method-call Derivation::target() line 42
- method-call Targets::resolve() line 42
- new Targets line 42
public function render(Output $out): voidTest 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
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::setting() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:204
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::setting() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:205
Type checks 2
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Table\Command\AlterKinds::check() packages/sql-semantics-postgres/src/Rules/Table/Command/AlterKinds.php:97
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Table\Command\AlterKinds::relationWide() packages/sql-semantics-postgres/src/Rules/Table/Command/AlterKinds.php:181