final class SecurityLabel
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

SECURITY LABEL [FOR provider] ON kind object IS 'label' | NULL: sets or removes a security label.

Mirrors PostgreSQL's SecLabelStmt. Without a provider the only loaded label provider is used. A labelled relation or column is resolved. Source: https://www.postgresql.org/docs/17/sql-security-label.html.

Reading the providerdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("SECURITY LABEL FOR selinux ON SCHEMA app IS 'x'");
    $operation->statement->provider?->word->value // => 'selinux'

Properties§

public ObjectKind $kind
public StringConstant|null $label
public Word|StringConstant|null $provider = null

Methods§

public function __construct(
    public ObjectKind $kind,
    public ObjectReference $object,
    public StringConstant|null $label,
    public Word|StringConstant|null $provider = null,
)

Parameters

$kindObjectKindThe kind of the object
$objectObjectReferenceThe object, named as SECURITY LABEL names objects of the kind
$labelStringConstant|nullThe label; null for NULL
$providerWord|StringConstant|nullThe label provider, if written
Calls 5
public function deriveStatement(Derivation $derivation): void

Derives the object.

Parameters

$derivationDerivation
Calls 2
public function render(Output $out): void

Writes the statement.

Parameters

$outOutput
Calls 4

Test cases 2§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 1

Relations§

Instantiated in 1
Type declarations 1