final class PublicationTable
    implements PublicationMember, Relation
    uses Snapshot
Public API: explicitly declared with @visibility public.

A table as an item of a publication: [ TABLE ] [ ONLY ] name [ * ] [ ( column, ... ) ] [ WHERE ( expression ) ].

Mirrors PublicationObjSpec of type TABLE with its PublicationTable. The table is a relation occurrence: its name is resolved, the column list names its columns and the row filter sees its row (PG-PUBLICATION-TABLE-001). A trailing * changes nothing, but marks a bare name continuing a list as a table, so it is kept. Source: https://www.postgresql.org/docs/17/sql-createpublication.html.

Resolving a published table and its row filterdoctest
$semantics = new \SqlSemantics\Platform\PostgreSql\Semantics();
    $profile = new \SqlSemantics\Platform\PostgreSql\Model\Contract\LanguageProfile(\SqlSemantics\Platform\PostgreSql\Model\Contract\GrammarRelease::PostgreSql172);
    $t = new \SqlSemantics\Platform\PostgreSql\Model\Statement\Declaration\Table(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\QualifiedName(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('t')), $profile, [new \SqlSemantics\Platform\PostgreSql\Model\Statement\Declaration\Column(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('a'), \SqlSemantics\Platform\PostgreSql\Statement\Type\Descriptor\Builtin::Int4)]);
    $operation = $semantics->analyze('CREATE PUBLICATION p FOR TABLE t (a) WHERE (a > 0)', [$t]);
    [$operation->facts->relation($operation->statement->objects[0])->table->table === $t, $operation->facts->diagnostics] // => [true, []]

Properties§

public list<Name> $columns
public Scalar|null $where = null
public bool $keyword = true
public bool $star = false

Methods§

public function __construct(
    public RelationReference $table,
    list<Name> $columns = [],
    public Scalar|null $where = null,
    public bool $keyword = true,
    public bool $star = false,
)

Parameters

$tableRelationReferenceThe table
$columnslist<Name>The published columns; empty for every column
$whereScalar|nullThe row filter, when WHERE is written
$keywordboolWhether TABLE is written
$starboolWhether a trailing `*` is written
Calls 3
public function introduced(): bool

Tells whether TABLE is written.

Returns

bool
public function bare(): bool

Tells whether the item is a bare name, which a list reads as the kind of the item before it.

Returns

bool
Test cases 1
public function deriveRelation(Derivation $derivation, Environment $environment): RelationFact

Resolves the table, checks the column list and derives the row filter.

Parameters

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

Writes the item.

Parameters

$outOutput
Calls 5

Test cases 6§

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

Dedicated tests 3
Other tests reaching this symbol 3

Relations§

Instantiated in 4
Type checks 5
Type declarations 2