final class RoleAttribute
    implements RoleOption
    uses Snapshot
Public API: explicitly declared with @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.

Reading the attribute a word namesdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE ROLE joe CREATEDB');
    $operation->statement->options[0]->flag() // => \SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Role\RoleFlag::CreateDb

Properties§

public Name $word

Methods§

public function __construct(public Name $word)

Parameters

$wordNameThe word as decoded
public function option(): ?string

Answers the option the word fills, or null when the word is not recognized.

Returns

?string
Test cases 2
Calls 1
public function render(Output $out): void

Writes the word as an identifier.

Parameters

$outOutput
Calls 2

Test cases 5§

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 1

Relations§

Instantiated in 1
Type checks 1