final class CreatePublication
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

A request to create a publication.

Rule: PG-PUBLICATION-001. Mirrors CreatePublicationStmt: name, either FOR ALL TABLES or the object list (or neither), and the publication parameters. The tables of the list are relation occurrences (PG-PUBLICATION-TABLE-001); the list is read and checked by PG-PUBLICATION-LIST-001. Source: https://www.postgresql.org/docs/17/sql-createpublication.html. Status: Implemented.

Publishing every tabledoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("CREATE PUBLICATION p FOR ALL TABLES WITH (publish = 'insert')");
    [$operation->statement->allTables, $operation->toString()] // => [true, "CREATE PUBLICATION p FOR ALL TABLES WITH (publish = 'insert')"]

Properties§

public list<PublicationMember> $objects
public list<Definition> $options
public Name $name
public bool $allTables = false

Methods§

public function __construct(
    public Name $name,
    public bool $allTables = false,
    list<PublicationMember> $objects = [],
    list<Definition> $options = [],
)

Parameters

$nameNameThe publication name
$allTablesboolWhether FOR ALL TABLES is written
$objectslist<PublicationMember>The tables and schemas in the order written; empty with FOR ALL TABLES
$optionslist<Definition>The publication parameters
Calls 6
public function deriveStatement(Derivation $derivation): void

Derives the published tables and the parameters and checks the list.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 2

Test cases 7§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 2
Other tests reaching this symbol 5

Relations§

Instantiated in 3