classAlterPublicationMembers
final class AlterPublicationMembers
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.A request to add, replace or remove tables and schemas of a publication.
Rule: PG-PUBLICATION-002. Mirrors AlterPublicationStmt with an AlterPublicationAction and an object list (PG-PUBLICATION-LIST-001); removing a table with a row filter or column list is a diagnostic. Source: https://www.postgresql.org/docs/17/sql-alterpublication.html. Status: Implemented.
(new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER PUBLICATION p DROP TABLE t WHERE (true)') // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\SemanticException: cannot use a WHERE clause when removing a table from a publicationProperties§
public non-empty-list<PublicationMember> $objectspublic Name $namepublic PublicationAction $actionMethods§
public function __construct(
public Name $name,
public PublicationAction $action,
list<PublicationMember> $objects,
)Parameters
$name | Name | The publication name |
$action | PublicationAction | Whether the objects are added, replace the list, or are removed |
$objects | list<PublicationMember> | The tables and schemas in the order written; at least one |
Calls 4
- static-call Check::listOf() line 44
- class-const PublicationMember::class() line 44
- method-call PublicationList::check() line 45
- new PublicationList line 45
public function deriveStatement(Derivation $derivation): voidDerives the tables and checks the list.
Parameters
$derivation | Derivation |
Calls 2
- method-call PublicationList::derive() line 53
- new PublicationList line 53
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 61
- class-const NameUse::Column() line 61
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 3
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\PublicationRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/PublicationRule.php:65
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\PublicationRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/PublicationRule.php:66
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\PublicationRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/PublicationRule.php:67