final class AttributeChange
    implements Clause
    uses Snapshot
Public API: explicitly declared with @visibility public.

One changed attribute of ALTER OPERATOR ... SET or ALTER TYPE ... SET.

Mirrors an operator_def_elem: name = NONE and the name written alone (PostgreSQL 17) both give the attribute no value, which removes a function the attribute names; the written form is kept. Otherwise the attribute holds its value as the command reads it. Source: operator_def_elem in src/backend/parser/gram.y of PostgreSQL 17.

Reading an attribute set to NONEdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER OPERATOR = (int4, int4) SET (restrict = NONE)');
    [$operation->statement->attributes[0]->none, $operation->statement->attributes[0]->attribute->value] // => [true, null]
Refusing NONE together with a valuedoctest
new \SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\AttributeChange(new \SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\Attribute(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('x'), null, new \SqlSemantics\Platform\PostgreSql\Statement\Literal\StringConstant('y')), true) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstruction

Properties§

public Attribute $attribute
public bool $none = false

Methods§

public function __construct(public Attribute $attribute, public bool $none = false)

Parameters

$attributeAttributeThe attribute with its value as the command reads it; without a value for NONE
$noneboolWhether the attribute is written `= NONE`
Calls 2
public function deriveClause(Derivation $derivation, Environment $environment): void

Derives the value.

Parameters

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

Writes the attribute, with = NONE when written so.

Parameters

$outOutput
Calls 3

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