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

DROP ROLE [IF EXISTS] role, … (8.0+): a request to remove roles.

Mirrors PT_drop_role. Rule: MYSQL-DROP-ROLE-001. Source: https://dev.mysql.com/doc/refman/8.4/en/drop-role.html. Status: Implemented.

Dropping a roledoctest
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('drop role if exists reader')->toString() // => 'DROP ROLE IF EXISTS reader'

Properties§

public list<AccountName> $roles
public bool $ifExists

Methods§

public function __construct(public bool $ifExists, list<AccountName> $roles)

Parameters

$ifExistsboolWhether IF EXISTS is written
$roleslist<AccountName>The roles in order; at least one
Calls 2
public function deriveStatement(Derivation $derivation): void

Derives nothing: the statement names no relation and no expression.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 2

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 1