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§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe hub
public function member(Form $form, int $at): ?RenamedMember

Lowers the renamed part that may follow RENAME at a position: opt_column name, CONSTRAINT name or ATTRIBUTE name; TO is null.

Parameters

$formForm
$atint
Test cases 1
Called from 1
Calls 7

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 $lowering

Test cases 2§

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

Dedicated tests 2

Relations§

Instantiated in 1
Method calls 1