classAlterGroupMembers
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.
$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> $memberspublic RoleSpec $grouppublic AddOrDrop $actionMethods§
public function __construct(
public RoleSpec $group,
public AddOrDrop $action,
list<RoleSpec> $members,
)Parameters
Calls 2
- static-call Check::listOf() line 45
- class-const RoleSpec::class() line 45
public function deriveStatement(Derivation $derivation): voidReports the problems of the group and of the members.
Parameters
$derivation | Derivation |
Calls 3
- new RoleChecks line 53
- method-call RoleChecks::alterable() line 54
- method-call RoleChecks::existing() line 55
public function render(Output $out): voidTest cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.