classOperatorClassRule
final class OperatorClassRule
Lowers operator classes, operator families and ALTER OPERATOR.
Rule: PG-OPCLASS-LOWER-001. Scope: CreateOpClassStmt, opclass_item_list, opclass_item, opt_opfamily, opclass_purpose, opt_recheck, CreateOpFamilyStmt, AlterOpFamilyStmt, opclass_drop_list, opclass_drop, AlterOperatorStmt, operator_def_list, operator_def_elem, operator_def_arg. Constructors: CreateOperatorClass, CreateOperatorFamily, OperatorFamilyAddition, OperatorFamilyRemoval, AlterOperator, the class items, MemberRemoval and AttributeChange. RECHECK is obsolete and ignored by the server; it is a noise word. Termination: lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/sql-createopclass.html, https://www.postgresql.org/docs/17/sql-alteropfamily.html, https://www.postgresql.org/docs/17/sql-alteroperator.html. Status: Implemented.
Methods§
Lowers CreateOpClassStmt, CreateOpFamilyStmt, AlterOpFamilyStmt or AlterOperatorStmt.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 13
- new CreateOperatorClass line 74
- method-call OperatorClassRule::items() line 78
- method-call OperatorClassRule::family() line 80
- new CreateOperatorFamily line 82
- new OperatorFamilyAddition line 83
- new OperatorFamilyRemoval line 84
- method-call OperatorClassRule::removals() line 84
- new AlterOperator line 85
- method-call SignatureRule::operator() line 85
- new SignatureRule line 85
- method-call OperatorClassRule::changes() line 85
- class-const OperatorChangeAttribute::class() line 85
- static-call ImplementationGap::production() line 86
public function items(Node $list): list<OperatorClassItem>Lowers opclass_item_list.
Parameters
$list | Node |
Returns
list<OperatorClassItem>Test cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::statement() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:78
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::statement() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:83
Calls 2
- method-call Lowering::items() line 98
- method-call OperatorClassRule::item() line 99
public function item(Node $item): OperatorClassItemLowers opclass_item.
Parameters
$item | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 8
- new SignatureRule line 114
- new OperatorMember line 117
- method-call OperatorClassRule::purpose() line 117
- method-call SignatureRule::operator() line 118
- new FunctionMember line 119
- method-call SignatureRule::function() line 119
- new StorageMember line 121
- static-call ImplementationGap::production() line 122
public function purpose(Node $purpose, Node $recheck): ?MemberPurposeLowers opclass_purpose, after checking the opt_recheck that follows it; no purpose is null.
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::item() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:117
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::item() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:118
Calls 2
- static-call ImplementationGap::production() line 135
- new MemberPurpose line 141
public function family(Node $family): ?DottedNameLowers opt_opfamily; no family is null.
Parameters
$family | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 1
- static-call ImplementationGap::production() line 159
public function removals(Node $list): list<MemberRemoval>Lowers opclass_drop_list.
Parameters
$list | Node |
Returns
list<MemberRemoval>Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 5
- method-call Lowering::items() line 173
- class-const MemberKind::Operator() line 176
- class-const MemberKind::Function() line 177
- static-call ImplementationGap::production() line 178
- new MemberRemoval line 180
public function changes(
Node $list,
class-string<KnownAttribute> $command,
): list<AttributeChange>Lowers operator_def_list into the attributes of the command whose attribute set is given; NONE and a name alone give no value.
Parameters
$list | Node | |
$command | class-string<KnownAttribute> |
Returns
list<AttributeChange>Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\OperatorClassRule::statement() packages/sql-semantics-postgres/src/Lowering/Routine/OperatorClassRule.php:85
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::attributeChanges() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:132
Calls 6
- new AttributeReader line 197
- method-call Lowering::items() line 199
- new AttributeChange line 203
- method-call AttributeReader::attribute() line 203
- method-call OperatorClassRule::argument() line 204
- static-call ImplementationGap::production() line 206
public function argument(Node $argument): TypeName|KeywordWord|OperatorName|SignedNumber|StringConstantLowers operator_def_arg.
Parameters
$argument | Node |
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 5
- new KeywordWord line 224
- new Name line 224
- method-call Keywords::word() line 224
- new Keywords line 224
- static-call ImplementationGap::production() line 228
Private surface 1§
Implementation details, listed for orientation only.
private Lowering $loweringTest cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 8
OperatorClassRuleTest::testArgumentLowersAReservedKeywordcallsOperatorClassRuleTest::testChangesLowersAnAttributeWithoutValueAndNonecallsOperatorClassRuleTest::testFamilyLowersTheFamilycallsOperatorClassRuleTest::testItemLowersOperandTypesOfAFunctioncallsOperatorClassRuleTest::testItemsLowersTheListcallsOperatorClassRuleTest::testPurposeLowersTheSortFamilycallsOperatorClassRuleTest::testRemovalsLowersTheKindscallsOperatorClassRuleTest::testStatementLowersClassesAndFamiliescalls
Relations§
Instantiated in 2
Method calls 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::statement() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:50
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Routine\Routines::attributeChanges() packages/sql-semantics-postgres/src/Lowering/Routine/Routines.php:132