final class UserComment
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

The ATTRIBUTE '…' or COMMENT '…' clause of CREATE USER or ALTER USER.

An attribute must be a JSON object; the server rejects anything else (ER_INVALID_USER_ATTRIBUTE_JSON), which the statement reports. Source: https://dev.mysql.com/doc/refman/8.4/en/create-user.html#create-user-comments-attributes.

Reading a commentdoctest
$comment = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("CREATE USER u COMMENT 'ops'")->statement->comment;
    [$comment?->kind, $comment?->text->value] // => [\SqlSemantics\Platform\MySql\Statement\Account\Option\CommentKind::Comment, 'ops']

Properties§

public CommentKind $kind
public Text $text

Methods§

public function __construct(public CommentKind $kind, public Text $text)

Parameters

$kindCommentKindWhether the attributes or the comment are set
$textTextThe JSON object or the comment
public function render(Output $out): void

Writes the clause.

Parameters

$outOutput
Calls 1

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 2
Type declarations 4