classRenameRule
final class RenameRule
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.
Lowers ALTER ... RENAME.
Rule: PG-RENAME-LOWER-001. Scope: RenameStmt. Constructor: Rename, as PostgreSQL builds one RenameStmt for every kind; the object part is read by PG-OBJECT-LOWER-001. COLUMN before a renamed column is a noise word. ALTER GROUP, ROLE and USER rename a role and keep their keyword. Source: https://www.postgresql.org/docs/17/sql-altertable.html, https://www.postgresql.org/docs/17/sql-alterrole.html. Status: Implemented.
Methods§
Lowers RenameStmt.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 12
- static-call ObjectKind::from() line 112
- class-const RenameRule::KINDS() line 112
- static-call ImplementationGap::production() line 112
- new ObjectRule line 113
- method-call ObjectRule::altered() line 114
- method-call ObjectRule::start() line 114
- method-call RenameRule::member() line 115
- function-call
countline 119 - class-const ObjectKind::Role() line 120
- class-const RenameRule::ROLE_WORDS() line 120
- new Rename line 122
- method-call ObjectRule::has() line 122
public function member(Form $form, int $at): ?RenamedMemberLowers the renamed part that may follow RENAME at a position: opt_column name, CONSTRAINT name or ATTRIBUTE name; TO is null.
Parameters
$form | Form | |
$at | int |
Returns
Test cases 1
Called from 1
Calls 7
- new ObjectRule line 130
- new RenamedMember line 135
- class-const RenamedPart::Column() line 135
- method-call Form::node() line 135
- class-const RenamedPart::Constraint() line 137
- class-const RenamedPart::Attribute() line 137
- method-call ObjectRule::token() line 138
Private surface 3§
Implementation details, listed for orientation only.
private const KINDS = ['RenameStmt: ALTER AGGREGATE aggregate_with_argtypes RENAME TO name' => 'AGGRE…private const ROLE_WORDS = ['GROUP_P' => \SqlSemantics\Platform\PostgreSql\Statement\Object\RoleWord::Grou…private Lowering $loweringTest cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.