classTableMutationResolver
final class TableMutationResolver
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Ddl resolver operations for PostgreSQL mutation.
Methods§
public function __construct(
PgSqlParser $parser,
PgSqlPartitionParser $partitionParser,
TableDefinitionRegistry $registry,
SchemaParser $schemaParser,
)Supplies the dependencies used by this TableMutationResolver.
Parameters
$parser | PgSqlParser | |
$partitionParser | PgSqlPartitionParser | |
$registry | TableDefinitionRegistry | |
$schemaParser | SchemaParser |
public function resolveCreateTable(string $sql): ShadowMutationResolve create table.
Parameters
$sql | string |
Returns
Test cases 1
Called from 1
Calls 19
- method-call PgSqlParser::extractCreateTableName() line 51
- new UnsupportedSqlException line 53
- method-call PgSqlParser::hasIfNotExists() line 56
- method-call TableDefinitionRegistry::has() line 58
- method-call PgSqlPartitionParser::parentTable() line 62
- method-call TableMutationResolver::resolvePartition() line 64
- method-call PgSqlParser::hasCreateTableLike() line 67
- method-call PgSqlParser::extractCreateTableLikeSource() line 68
- new UnknownSchemaException line 70
- new CreateTableLikeMutation line 73
- method-call PgSqlParser::hasCreateTableAsSelect() line 76
- method-call PgSqlParser::extractCreateTableSelectSql() line 77
- method-call SelectColumns::extractSelectColumnNames() line 78
- new SelectColumns line 78
- new CreateTableAsSelectMutation line 80
- new ColumnDeclaration line 84
- class-const ColumnTypeFamily::TEXT() line 84
- method-call SchemaParser::parse() line 89
- new CreateTableMutation line 91
public function resolveDropTable(string $sql): ShadowMutationResolve drop table.
Parameters
$sql | string |
Returns
Test cases 1
Called from 1
Calls 6
- method-call PgSqlParser::extractDropTableName() line 101
- new UnsupportedSqlException line 103
- method-call PgSqlParser::hasDropTableIfExists() line 106
- method-call TableDefinitionRegistry::has() line 108
- new UnknownSchemaException line 109
- new DropTableMutation line 112
public function resolveAlterTable(string $sql): ?ShadowMutationResolve alter table.
Parameters
$sql | string |
Returns
Called from 1
Calls 4
- method-call PgSqlParser::extractAlterTableName() line 122
- new UnsupportedSqlException line 124
- method-call TableDefinitionRegistry::has() line 127
- new UnknownSchemaException line 128
public function resolvePartition(
string $sql,
string $tableName,
string $parentTable,
bool $ifNotExists,
): ShadowMutationInherits a partition parent's definition while preserving child key metadata.
Parameters
$sql | string | |
$tableName | string | |
$parentTable | string | |
$ifNotExists | bool |
Returns
Called from 1
Calls 6
- method-call TableDefinitionRegistry::get() line 140
- new UnknownSchemaException line 142
- new UnsupportedSqlException line 145
- method-call PgSqlPartitionParser::parseRelation() line 147
- method-call PgSqlPartitionParser::parseKey() line 153
- new CreateTableMutation line 158
Private surface 4§
Implementation details, listed for orientation only.
private PgSqlParser $parserprivate PgSqlPartitionParser $partitionParserprivate TableDefinitionRegistry $registryprivate SchemaParser $schemaParserTest cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
TableMutationResolverTest::testResolveAlterTableRejectsUnsupportedSchemaChangescallsTableMutationResolverTest::testResolveCreateTableRegistersItsSchemaOnlyWhenAppliedcallsTableMutationResolverTest::testResolveDropTableRemovesOnlyTheTargetcallsTableMutationResolverTest::testResolvePartitionInheritsItsParentDefinitioncalls
Other tests reaching this symbol 4
PgSqlSessionFactoryTestcallsPgSqlRewriterTestcallsStatementRewriterTestcallsPgSqlMutationResolverTestcalls
Relations§
Instantiated in 3
- new ZtdQuery\Platform\Postgres\Shadow\PgSqlMutationResolver::resolve() packages/ztd-query-postgres/src/Shadow/PgSqlMutationResolver.php:58
- new ZtdQuery\Platform\Postgres\Shadow\PgSqlMutationResolver::resolve() packages/ztd-query-postgres/src/Shadow/PgSqlMutationResolver.php:59
- new ZtdQuery\Platform\Postgres\Shadow\PgSqlMutationResolver::resolve() packages/ztd-query-postgres/src/Shadow/PgSqlMutationResolver.php:60
Method calls 3
- method-call ZtdQuery\Platform\Postgres\Shadow\PgSqlMutationResolver::resolve() packages/ztd-query-postgres/src/Shadow/PgSqlMutationResolver.php:58
- method-call ZtdQuery\Platform\Postgres\Shadow\PgSqlMutationResolver::resolve() packages/ztd-query-postgres/src/Shadow/PgSqlMutationResolver.php:59
- method-call ZtdQuery\Platform\Postgres\Shadow\PgSqlMutationResolver::resolve() packages/ztd-query-postgres/src/Shadow/PgSqlMutationResolver.php:60