mini\Parsing\SQL\SqlRenderer::renameIdentifier() Method

public

Signature

public function renameIdentifier(mini\Parsing\SQL\AST\ASTNode $node, string $oldName, string $newName): mini\Parsing\SQL\AST\ASTNode

Parameters

Name Type Default Description
$node mini\Parsing\SQL\AST\ASTNode required Documentation missing
$oldName string required Documentation missing
$newName string required Documentation missing

Returns

mini\Parsing\SQL\AST\ASTNode

Documentation

Rename an identifier throughout an AST

Creates a new AST with all occurrences of $oldName replaced with $newName. Used for CTE renaming when composing queries.

Only renames table/CTE references (single-part identifiers that match exactly). Does not rename column qualifiers like users.id to _cte_123.id since the table alias should be preserved.

Source

src/Parsing/SQL/SqlRenderer.php:559-636