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.

Reading the publications of a subscriptiondoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("CREATE SUBSCRIPTION s CONNECTION 'host=a' PUBLICATION p1, p2 WITH (enabled = false)");
    count($operation->statement->publications) // => 2

Properties§

public non-empty-list<Name> $publications
public list<Definition> $options
public Name $name
public StringConstant $connection

Methods§

public function __construct(
    public Name $name,
    public StringConstant $connection,
    list<Name> $publications,
    list<Definition> $options = [],
)

Parameters

$nameNameThe subscription name
$connectionStringConstantThe connection string
$publicationslist<Name>The publications on the publisher; at least one
$optionslist<Definition>The parameters
Calls 3
public function deriveStatement(Derivation $derivation): void

Derives the parameter values.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 4

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 1