classAccountName
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.
$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 $userpublic Name|null $host = nullMethods§
public function render(Output $out): voidWrites the user part and, joined by @ without spaces, the host part.
Parameters
$out | Output |
Test cases 3
Calls 3
- method-call Output::name() line 42
- class-const NameUse::Label() line 42
- method-call Output::glue() line 44
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
- new SqlSemantics\Platform\MySql\Lowering\Account\PrivilegeRule::item() packages/sql-semantics-mysql/src/Lowering/Account/PrivilegeRule.php:171
- new SqlSemantics\Platform\MySql\Lowering\Account\PrivilegeRule::named() packages/sql-semantics-mysql/src/Lowering/Account/PrivilegeRule.php:184
- new SqlSemantics\Platform\MySql\Lowering\Leaf\UserRule::account() packages/sql-semantics-mysql/src/Lowering/Leaf/UserRule.php:53
- new SqlSemantics\Platform\MySql\Lowering\Leaf\UserRule::account() packages/sql-semantics-mysql/src/Lowering/Leaf/UserRule.php:54
Constant reads 5
- class-const SqlSemantics\Platform\MySql\Statement\Account\CreateRole::__construct() packages/sql-semantics-mysql/src/Statement/Account/CreateRole.php:39
- class-const SqlSemantics\Platform\MySql\Statement\Account\CreateUser::__construct() packages/sql-semantics-mysql/src/Statement/Account/CreateUser.php:78
- class-const SqlSemantics\Platform\MySql\Statement\Account\DropRole::__construct() packages/sql-semantics-mysql/src/Statement/Account/DropRole.php:39
- class-const SqlSemantics\Platform\MySql\Statement\Account\SetDefaultRole::__construct() packages/sql-semantics-mysql/src/Statement/Account/SetDefaultRole.php:44
- class-const SqlSemantics\Platform\MySql\Statement\Account\User\RoleSelection::__construct() packages/sql-semantics-mysql/src/Statement/Account/User/RoleSelection.php:40
Type checks 5
- instanceof SqlSemantics\Platform\MySql\Lowering\Account\RoleRule::roles() packages/sql-semantics-mysql/src/Lowering/Account/RoleRule.php:79
- instanceof SqlSemantics\Platform\MySql\Lowering\Replication\SourceValueRule::privilegeChecks() packages/sql-semantics-mysql/src/Lowering/Replication/SourceValueRule.php:113
- instanceof SqlSemantics\Platform\MySql\Statement\Replication\Source\SourceOptionKind::accepts() packages/sql-semantics-mysql/src/Statement/Replication/Source/SourceOptionKind.php:105
- instanceof SqlSemantics\Platform\MySql\Statement\Utility\Show\Server\ShowCreateUser::deriveStatement() packages/sql-semantics-mysql/src/Statement/Utility/Show/Server/ShowCreateUser.php:49
- instanceof SqlSemantics\Platform\MySql\Statement\Utility\Show\Server\ShowGrants::deriveStatement() packages/sql-semantics-mysql/src/Statement/Utility/Show/Server/ShowGrants.php:60
Type declarations 5
- type SqlSemantics\Platform\MySql\Lowering\Replication\SourceValueRule packages/sql-semantics-mysql/src/Lowering/Replication/SourceValueRule.php:59
- type SqlSemantics\Platform\MySql\Lowering\Replication\SourceValueRule packages/sql-semantics-mysql/src/Lowering/Replication/SourceValueRule.php:103
- type SqlSemantics\Platform\MySql\Statement\Account\Privilege\Item\GrantedRole packages/sql-semantics-mysql/src/Statement/Account/Privilege/Item/GrantedRole.php:28
- type SqlSemantics\Platform\MySql\Statement\Replication\Source\SourceOption packages/sql-semantics-mysql/src/Statement/Replication/Source/SourceOption.php:43
- type SqlSemantics\Platform\MySql\Statement\Replication\Source\SourceOptionKind packages/sql-semantics-mysql/src/Statement/Replication/Source/SourceOptionKind.php:94