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

One option of a role membership grant: ADMIN, INHERIT or SET with OPTION, TRUE or FALSE.

Mirrors the DefElem of grant_role_opt. The grammar accepts any label as the option name and the server recognizes admin, inherit and set; another name is reported by the statement. Source: https://www.postgresql.org/docs/17/sql-grant.html.

Reading a membership optiondoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('GRANT staff TO joe WITH INHERIT FALSE');
    [$operation->statement->options[0]->name->value, $operation->statement->options[0]->recognized(), $operation->statement->options[0]->setting->enabled()] // => ['inherit', true, false]

Constants§

public const RECOGNIZED = ['admin', 'inherit', 'set']

The option names the server recognizes.

Properties§

public Name $name

Methods§

public function __construct(public Name $name, public MembershipSetting $setting)

Parameters

$nameNameThe option name as decoded
$settingMembershipSettingThe value
public function recognized(): bool

Tells whether the server recognizes the option name.

Returns

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

Writes the name and the value.

Parameters

$outOutput
Calls 2

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 1
Constant reads 2