classPublicationList
final class PublicationList
Reads and checks the object list of CREATE and ALTER PUBLICATION.
Rule: PG-PUBLICATION-LIST-001. An item without TABLE or TABLES IN SCHEMA continues the kind of the item before it, as the grammar's preprocess_pubobj_list does: a bare name after a schema item is a schema, any other unintroduced name is a table, and CURRENT_SCHEMA alone is the current schema. A list cannot start without keywords ("invalid
- publication object list"); CURRENT_SCHEMA cannot continue tables
("invalid table name"); a table written with a qualifier, ONLY, a star, a column list or a row filter cannot continue schemas ("WHERE clause not
- allowed for schema", "column specification not allowed for schema",
"invalid schema name"). Removing tables with a row filter or a column list is rejected. A list whose rendering would be read with another kind is not constructed. Termination: one pass over a finite list. Source: https://www.postgresql.org/docs/17/sql-createpublication.html, https://www.postgresql.org/docs/17/sql-alterpublication.html. Status: Implemented.
Methods§
public function check(list<PublicationMember> $objects): voidChecks that each item renders as the kind the list would read it as.
Parameters
$objects | list<PublicationMember> |
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Statement\Catalog\Publication\AlterPublicationMembers::__construct() packages/sql-semantics-postgres/src/Statement/Catalog/Publication/AlterPublicationMembers.php:45
- method-call SqlSemantics\Platform\PostgreSql\Statement\Catalog\Publication\CreatePublication::__construct() packages/sql-semantics-postgres/src/Statement/Catalog/Publication/CreatePublication.php:57
Calls 1
- static-call Check::input() line 49
public function derive(
Derivation $derivation,
list<PublicationMember> $objects,
?PublicationAction $action,
): voidDerives the items and reports the problems of the list.
Parameters
$derivation | Derivation | |
$objects | list<PublicationMember> | |
$action | ?PublicationAction |
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Statement\Catalog\Publication\AlterPublicationMembers::deriveStatement() packages/sql-semantics-postgres/src/Statement/Catalog/Publication/AlterPublicationMembers.php:53
- method-call SqlSemantics\Platform\PostgreSql\Statement\Catalog\Publication\CreatePublication::deriveStatement() packages/sql-semantics-postgres/src/Statement/Catalog/Publication/CreatePublication.php:65
Calls 5
- method-call Derivation::relation() line 68
- new Environment line 68
- method-call PublicationList::rule() line 70
- method-call Derivation::report() line 72
- new CatalogMisuse line 72
public function rule(
?PublicationMember $previous,
PublicationMember $object,
?PublicationAction $action,
): ?CatalogMisuseRuleAnswers the rule an item breaks after the item before it, or null.
Parameters
$previous | ?PublicationMember | |
$object | PublicationMember | |
$action | ?PublicationAction |
Returns
Test cases 1
Called from 1
Calls 9
- method-call PublicationMember::introduced() line 83
- class-const CatalogMisuseRule::PublicationListStart() line 84
- class-const CatalogMisuseRule::PublicationTableName() line 87
- class-const CatalogMisuseRule::PublicationSchemaWhere() line 91
- class-const CatalogMisuseRule::PublicationSchemaColumns() line 92
- class-const CatalogMisuseRule::PublicationSchemaName() line 93
- class-const PublicationAction::Drop() line 96
- class-const CatalogMisuseRule::PublicationDropWhere() line 98
- class-const CatalogMisuseRule::PublicationDropColumns() line 99
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 4
- new SqlSemantics\Platform\PostgreSql\Statement\Catalog\Publication\AlterPublicationMembers::__construct() packages/sql-semantics-postgres/src/Statement/Catalog/Publication/AlterPublicationMembers.php:45
- new SqlSemantics\Platform\PostgreSql\Statement\Catalog\Publication\AlterPublicationMembers::deriveStatement() packages/sql-semantics-postgres/src/Statement/Catalog/Publication/AlterPublicationMembers.php:53
- new SqlSemantics\Platform\PostgreSql\Statement\Catalog\Publication\CreatePublication::__construct() packages/sql-semantics-postgres/src/Statement/Catalog/Publication/CreatePublication.php:57
- new SqlSemantics\Platform\PostgreSql\Statement\Catalog\Publication\CreatePublication::deriveStatement() packages/sql-semantics-postgres/src/Statement/Catalog/Publication/CreatePublication.php:65
Method calls 4
- method-call SqlSemantics\Platform\PostgreSql\Statement\Catalog\Publication\AlterPublicationMembers::__construct() packages/sql-semantics-postgres/src/Statement/Catalog/Publication/AlterPublicationMembers.php:45
- method-call SqlSemantics\Platform\PostgreSql\Statement\Catalog\Publication\AlterPublicationMembers::deriveStatement() packages/sql-semantics-postgres/src/Statement/Catalog/Publication/AlterPublicationMembers.php:53
- method-call SqlSemantics\Platform\PostgreSql\Statement\Catalog\Publication\CreatePublication::__construct() packages/sql-semantics-postgres/src/Statement/Catalog/Publication/CreatePublication.php:57
- method-call SqlSemantics\Platform\PostgreSql\Statement\Catalog\Publication\CreatePublication::deriveStatement() packages/sql-semantics-postgres/src/Statement/Catalog/Publication/CreatePublication.php:65