final class AccountName
    implements Account
    uses Snapshot
Public API: explicitly declared with @visibility public.

A user or role account name: the user part and the optional host part.

An account written without a host part denotes the host %; the host is kept absent, as written. Role names have the same two parts. Source: https://dev.mysql.com/doc/refman/8.4/en/account-names.html, https://dev.mysql.com/doc/refman/8.4/en/role-names.html.

Reading the parts of an account namedoctest
$account = new \SqlSemantics\Platform\MySql\Statement\Name\AccountName(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('app'), new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('10.0.%'));
    [$account->user->value, $account->host?->value] // => ['app', '10.0.%']

Properties§

public Name $user
public Name|null $host = null

Methods§

public function __construct(public Name $user, public Name|null $host = null)

Parameters

$userNameThe user part
$hostName|nullThe host part, when written
public function render(Output $out): void

Writes the user part and, joined by @ without spaces, the host part.

Parameters

$outOutput
Test cases 3
Calls 3

Test cases 9§

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

Dedicated tests 4
Other tests reaching this symbol 5

Relations§

Instantiated in 4
Constant reads 5
Type checks 5
Type declarations 5