classAccountOption
final class AccountOption
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.One password management or account locking option of CREATE USER or ALTER USER, with its number when it takes one.
The number is kept as written. Several options may be written; for one field the last option written wins in the server, so the list keeps every option in source order. Source: https://dev.mysql.com/doc/refman/8.4/en/create-user.html#create-user-password-management.
$option = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('CREATE USER u PASSWORD HISTORY 5')->statement->options[0];
[$option->kind, $option->number?->text] // => [\SqlSemantics\Platform\MySql\Statement\Account\Option\AccountOptionKind::HistoryCount, '5']Properties§
public AccountOptionKind $kindpublic Numeral|null $number = nullMethods§
public function __construct(public AccountOptionKind $kind, public Numeral|null $number = null)Parameters
$kind | AccountOptionKind | The option |
$number | Numeral|null | The number of an option that takes one |
Calls 2
- static-call Check::input() line 36
- method-call AccountOptionKind::numbered() line 36
public function render(Output $out): voidWrites the option.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 44
- method-call AccountOptionKind::words() line 44
- method-call AccountOptionKind::unit() line 45
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
AccountOptionTestcalls
Relations§
Instantiated in 2
Constant reads 2
- class-const SqlSemantics\Platform\MySql\Statement\Account\AlterUser::__construct() packages/sql-semantics-mysql/src/Statement/Account/AlterUser.php:79
- class-const SqlSemantics\Platform\MySql\Statement\Account\CreateUser::__construct() packages/sql-semantics-mysql/src/Statement/Account/CreateUser.php:80