classRoleAttribute
final class RoleAttribute
implements RoleOption
uses Snapshot
@visibility public.A role option written as a plain word, such as SUPERUSER, NOCREATEDB or LOGIN.
The grammar reads the word as an identifier and the server compares it with its list of role attributes (RoleFlag); a word that is not in the list is rejected as an unrecognized role option, which the statement reports. The word is compared as decoded, so a quoted word in another letter case names no attribute. Source: https://www.postgresql.org/docs/17/sql-createrole.html.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE ROLE joe CREATEDB');
$operation->statement->options[0]->flag() // => \SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Role\RoleFlag::CreateDbProperties§
public Name $wordMethods§
public function flag(): ?RoleFlagAnswers the role attribute the word names, or null when the server does not recognize the word.
Returns
Test cases 2
Called from 1
Calls 1
- static-call RoleFlag::tryFrom() line 43
public function option(): ?stringAnswers the option the word fills, or null when the word is not recognized.
Returns
?stringTest cases 2
Calls 1
- method-call RoleAttribute::flag() line 51
public function render(Output $out): voidWrites the word as an identifier.
Parameters
$out | Output |
Calls 2
- method-call Output::name() line 59
- class-const NameUse::Identifier() line 59
Test cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.