classAttributeChange
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.
$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]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\InvalidConstructionProperties§
public Attribute $attributepublic bool $none = falseMethods§
public function __construct(public Attribute $attribute, public bool $none = false)Parameters
$attribute | Attribute | The attribute with its value as the command reads it; without a value for NONE |
$none | bool | Whether the attribute is written `= NONE` |
Calls 2
- static-call Check::input() line 41
- method-call Attribute::valued() line 41
public function deriveClause(Derivation $derivation, Environment $environment): voidDerives the value.
Parameters
$derivation | Derivation | |
$environment | Environment |
Calls 1
- method-call Attribute::deriveClause() line 49
public function render(Output $out): voidWrites the attribute, with = NONE when written so.
Parameters
$out | Output |
Calls 3
- method-call Output::name() line 58
- class-const NameUse::Label() line 58
- method-call Output::node() line 60
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
AttributeChangeTestcalls
Other tests reaching this symbol 1
Relations§
Instantiated in 3
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::changes() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:203
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::changes() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:204
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::changes() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:205
Constant reads 2
- class-const SqlSemantics\Platform\PostgreSql\Statement\Catalog\Type\AlterTypeOptions::__construct() packages/sql-semantics-postgres/src/Statement/Catalog/Type/AlterTypeOptions.php:45
- class-const SqlSemantics\Platform\PostgreSql\Statement\Operator\AlterOperator::__construct() packages/sql-semantics-postgres/src/Statement/Operator/AlterOperator.php:49