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

A request to add members to a role or remove them, written as ALTER GROUP ... ADD USER or DROP USER.

Rule: PG-ROLE-GROUP-001. Mirrors AlterRoleStmt with action +1 (ADD) or -1 (DROP) and the single option rolemembers. Reported: PUBLIC as the group or as a member, and a pg_ name as the group. Source: https://www.postgresql.org/docs/17/sql-altergroup.html. Status: Implemented.

Reading the members removed from a groupdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER GROUP staff DROP USER joe, ann');
    [$operation->statement->action->value, count($operation->statement->members)] // => ['DROP', 2]

Properties§

public non-empty-list<RoleSpec> $members
public RoleSpec $group
public AddOrDrop $action

Methods§

public function __construct(
    public RoleSpec $group,
    public AddOrDrop $action,
    list<RoleSpec> $members,
)

Parameters

$groupRoleSpecThe role whose members change
$actionAddOrDropWhether the members are added or removed
$memberslist<RoleSpec>The members in the order written, at least one
Calls 2
public function deriveStatement(Derivation $derivation): void

Reports the problems of the group and of the members.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 1

Test cases 2§

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

Dedicated tests 2

Relations§

Instantiated in 1