final class RelationTargets
Restricted visibility: declared "@visibility SqlSemantics\Platform\PostgreSql". Code outside that scope must not name this declaration.

Resolves the relations and columns a generic object command names.

Rule: PG-OBJECT-RELATION-001. A table, view, materialized view or foreign table named by DROP, COMMENT, SECURITY LABEL or an ALTER command, the table a policy, rule, trigger or table constraint belongs to, and the table of a column are resolved along the search path (CORE-TABLE-LOOKUP-001) and recorded as the relation fact of the object reference: a declared relation with its columns, an undeclared one as an open shape naming the missing declaration, a missing or conflicting one as a diagnostic. A relation that IF EXISTS lets the server skip is recorded without a table and is no diagnostic. A dotted relation name of more than three parts is reported. A column is named by a dotted name whose last part is the column: one part is reported as unqualified, more than four parts as an improper relation name, and a column the declared complete relation certainly lacks is reported. Renaming a column to a name the relation certainly has is reported. Indexes and sequences are not declarations the context can hold and are not resolved. Terminates: one lookup per reference. Source: https://www.postgresql.org/docs/17/sql-comment.html, https://www.postgresql.org/docs/17/sql-droptable.html, https://www.postgresql.org/docs/17/sql-altertable.html, https://www.postgresql.org/docs/17/ddl-schemas.html#DDL-SCHEMAS-PATH. Status: Implemented.

Methods§

public function resolve(
    ObjectKind $kind,
    ObjectReference $object,
    bool $ifExists,
    Derivation $derivation,
): ?RelationFact
public function record(
    ObjectReference $reference,
    QualifiedName $name,
    bool $ifExists,
    Derivation $derivation,
): RelationFact
public function column(DottedName $name, Derivation $derivation): RelationFact
public function renamed(RelationFact $fact, Name $column, Derivation $derivation): void
public function has(RelationFact $fact, Name $column, Derivation $derivation): ?bool
public function spelled(list<Name> $parts): string

Spells dotted name parts for a message.

Parameters

$partslist<Name>

Returns

string
Test cases 1
Called from 1
Calls 1

Test cases 9§

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

Dedicated tests 9

Relations§

Instantiated in 2
Method calls 3