classAlterSubscriptionPublications
final class AlterSubscriptionPublications
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.A request to add, replace or remove the publications a subscription subscribes to.
Rule: PG-SUBSCRIPTION-005. Mirrors AlterSubscriptionStmt of kind ALTER_SUBSCRIPTION_ADD_PUBLICATION, _SET_PUBLICATION or _DROP_PUBLICATION. Source: https://www.postgresql.org/docs/17/sql-altersubscription.html. Status: Implemented.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER SUBSCRIPTION s ADD PUBLICATION p3');
[$operation->statement->action, $operation->statement->publications[0]->value] // => [\SqlSemantics\Platform\PostgreSql\Statement\Catalog\Publication\PublicationAction::Add, 'p3']Properties§
public non-empty-list<Name> $publicationspublic list<Definition> $optionspublic Name $namepublic PublicationAction $actionMethods§
public function __construct(
public Name $name,
public PublicationAction $action,
list<Name> $publications,
list<Definition> $options = [],
)Parameters
$name | Name | The subscription name |
$action | PublicationAction | Whether the publications are added, replace the list, or are removed |
$publications | list<Name> | The publications; at least one |
$options | list<Definition> | The options |
Calls 3
- static-call Check::listOf() line 52
- class-const Name::class() line 52
- class-const Definition::class() line 53
public function deriveStatement(Derivation $derivation): voidDerives the option values.
Parameters
$derivation | Derivation |
Calls 2
- method-call ClauseFacts::derive() line 61
- new ClauseFacts line 61
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 69
- class-const NameUse::Column() line 69
- method-call Output::symbol() line 72
- method-call Output::name() line 74
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\SubscriptionRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/SubscriptionRule.php:59
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\SubscriptionRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/SubscriptionRule.php:60
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\SubscriptionRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/SubscriptionRule.php:61