classCreateRole
final class CreateRole
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.CREATE ROLE [IF NOT EXISTS] role, … (8.0+): a request to create roles, which are locked accounts.
Mirrors PT_create_role. Rule: MYSQL-CREATE-ROLE-001. Source: https://dev.mysql.com/doc/refman/8.4/en/create-role.html. Status: Implemented.
(new \SqlSemantics\Platform\MySql\Semantics())->analyze("create role if not exists reader, 'writer'@'%'")->toString() // => 'CREATE ROLE IF NOT EXISTS reader, writer@`%`'Properties§
public list<AccountName> $rolespublic bool $ifNotExistsMethods§
public function __construct(public bool $ifNotExists, list<AccountName> $roles)Parameters
$ifNotExists | bool | Whether IF NOT EXISTS is written |
$roles | list<AccountName> | The roles in order; at least one |
Calls 2
- static-call Check::listOf() line 39
- class-const AccountName::class() line 39
public function deriveStatement(Derivation $derivation): voidDerives nothing: the statement names no relation and no expression.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 54
- method-call Output::list() line 58
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
CreateRoleTestcalls