classCreateSubscription
final class CreateSubscription
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.A request to create a subscription to publications of another server.
Rule: PG-SUBSCRIPTION-001. Mirrors CreateSubscriptionStmt: name, connection string, publication names on the publisher and parameters. Source: https://www.postgresql.org/docs/17/sql-createsubscription.html. Status: Implemented.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("CREATE SUBSCRIPTION s CONNECTION 'host=a' PUBLICATION p1, p2 WITH (enabled = false)");
count($operation->statement->publications) // => 2Properties§
public non-empty-list<Name> $publicationspublic list<Definition> $optionspublic Name $namepublic StringConstant $connectionMethods§
public function __construct(
public Name $name,
public StringConstant $connection,
list<Name> $publications,
list<Definition> $options = [],
)Parameters
$name | Name | The subscription name |
$connection | StringConstant | The connection string |
$publications | list<Name> | The publications on the publisher; at least one |
$options | list<Definition> | The parameters |
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 parameter 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
CreateSubscriptionTestcalls