classRenameResolver
final class RenameResolver
Restricted visibility: declared "@visibility ZtdQuery\Platform\Sqlite". Code outside that scope must not name this declaration.
Builds schema changes for renaming a table or column.
Methods§
public function __construct(private TableDefinitionRegistry $registry)Binds the collaborators used by this operation.
Parameters
$registry | TableDefinitionRegistry |
public function resolveAlterRenameTable(
string $sql,
string $tableName,
string $tableClause,
): ShadowMutationBuilds schema changes for renaming a table or column.
Parameters
$sql | string | |
$tableName | string | |
$tableClause | string |
Returns
Throws
Test cases 1
Called from 1
Calls 8
- method-call AlterOperationParser::singleIdentifier() line 36
- new AlterOperationParser line 36
- new UnsupportedSqlException line 38
- method-call MutationTableLookup::definition() line 41
- new MutationTableLookup line 41
- method-call AlteredTableProjection::alterMutation() line 43
- new AlteredTableProjection line 43
- method-call AlteredTableProjection::quotedColumns() line 48
public function resolveAlterRenameColumn(
string $sql,
string $tableName,
string $columnClause,
): ShadowMutationBuilds schema changes for renaming a table or column.
Parameters
$sql | string | |
$tableName | string | |
$columnClause | string |
Returns
Test cases 2
Called from 1
Calls 13
- method-call AlterOperationParser::renamedIdentifiers() line 60
- new AlterOperationParser line 60
- new UnsupportedSqlException line 62
- method-call MutationTableLookup::definition() line 66
- new MutationTableLookup line 66
- method-call AlteredTableProjection::existingColumn() line 67
- new AlteredTableProjection line 67
- new ColumnNotFoundException line 69
- function-call
strcasecmpline 72 - new ColumnAlreadyExistsException line 73
- method-call RenameResolver::definitionWithRenamedColumn() line 76
- method-call AlteredTableProjection::quote() line 79
- method-call AlteredTableProjection::alterMutation() line 86
public function definitionWithRenamedColumn(
TableDefinition $existing,
string $oldName,
string $newName,
): TableDefinitionRenames a column consistently throughout key and column metadata.
Parameters
$existing | TableDefinition | |
$oldName | string | |
$newName | string |
Returns
Called from 1
Calls 5
- static-call ColumnDefinitionEditor::renamedColumns() line 94
- new TableDefinition line 100
- static-call ColumnDefinitionEditor::renamedMapKey() line 102
- function-call
array_mapline 110 - static-call ColumnDefinitionEditor::renamedForeignKey() line 111
Private surface 1§
Implementation details, listed for orientation only.
private TableDefinitionRegistry $registryTest cases 9§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
RenameResolverTest::testDefinitionWithRenamedColumnUpdatesKeyAndValueMapscallsRenameResolverTest::testResolveAlterRenameColumnProjectsNewNamecallsRenameResolverTest::testResolveAlterRenameColumnRejectsExistingTargetNamecallsRenameResolverTest::testResolveAlterRenameTableMovesSchemaAndRowsAtApplycalls
Other tests reaching this symbol 5
SqliteRewriterTestcallsStatementRewriterTestcallsTableMutationResolverTestcallsSqliteMutationResolverTestcallsSqliteSessionFactoryTestcalls
Relations§
Instantiated in 2
- new ZtdQuery\Platform\Sqlite\Shadow\Resolution\TableMutationResolver::resolveAlterTable() packages/ztd-query-sqlite/src/Shadow/Resolution/TableMutationResolver.php:108
- new ZtdQuery\Platform\Sqlite\Shadow\Resolution\TableMutationResolver::resolveAlterTable() packages/ztd-query-sqlite/src/Shadow/Resolution/TableMutationResolver.php:109
Method calls 2
- method-call ZtdQuery\Platform\Sqlite\Shadow\Resolution\TableMutationResolver::resolveAlterTable() packages/ztd-query-sqlite/src/Shadow/Resolution/TableMutationResolver.php:108
- method-call ZtdQuery\Platform\Sqlite\Shadow\Resolution\TableMutationResolver::resolveAlterTable() packages/ztd-query-sqlite/src/Shadow/Resolution/TableMutationResolver.php:109