classInsertTarget
final class InsertTarget
Validated target metadata and identity input for an INSERT projection.
Accepts the public transformer context and narrows fixture cells to the only values the identity allocator recognizes: integers and numeric strings.
Properties§
public string $tableNametableName used to construct the projected row.
public list<string> $tableColumnstableColumns used to construct the projected row.
public list<string> $insertColumnsinsertColumns used to construct the projected row.
public array<string, ColumnDeclaration> $columnTypescolumnTypes used to construct the projected row.
public array<string, string> $columnDefaultscolumnDefaults used to construct the projected row.
public array<string, IdentityGenerationStrategy> $identityStrategiesidentityStrategies used to construct the projected row.
public array<int, array<string, int|string>> $existingRowsexistingRows used to construct the projected row.
public array<string, array<int, string>> $candidateKeyscandidateKeys used to construct the projected row.
Methods§
public function __construct(
string $tableName,
list<string> $tableColumns,
list<string> $insertColumns,
array<string, ColumnDeclaration> $columnTypes,
array<string, string> $columnDefaults,
array<string, IdentityGenerationStrategy> $identityStrategies,
array<int, array<string, int|string>> $existingRows,
array<string, array<int, string>> $candidateKeys,
)Create a target from already validated column and identity metadata.
Parameters
$tableName | string | |
$tableColumns | list<string> | |
$insertColumns | list<string> | |
$columnTypes | array<string, ColumnDeclaration> | |
$columnDefaults | array<string, string> | |
$identityStrategies | array<string, IdentityGenerationStrategy> | |
$existingRows | array<int, array<string, int|string>> | |
$candidateKeys | array<string, array<int, string>> |
public static function fromStatement(
InsertStatement $statement,
array<string, array{viewSql: string}|array{rows: array<int, array<string, mixed>>, columns: array<int, string>, columnTypes: array<string, ColumnDeclaration>, columnDefaults?: array<string, string>, identityStrategies?: array<string, IdentityGenerationStrategy>, candidateKeys?: array<string, array<int, string>>}> $tables,
string $sql,
): selfParameters
$statement | InsertStatement | |
$tables | array<string, array{viewSql: string}|array{rows: array<int, array<string, mixed>>, columns: array<int, string>, columnTypes: array<string, ColumnDeclaration>, columnDefaults?: array<string, string>, identityStrategies?: array<string, IdentityGenerationStrategy>, candidateKeys?: array<string, array<int, string>>}> | |
$sql | string |
Returns
selfThrows
Test cases 2
Called from 1
Calls 5
- new UnsupportedSqlException line 112
- function-call
is_stringline 116 - static-call ResultProjection::orderedValues() line 121
- function-call
is_intline 134 - new
selfline 141
Test cases 12§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 10
MySqlSessionFactoryTestcallsMySqlRewriterTestcallsStatementRewriterTestcallsResultProjectionTest::testBuildInsertRowSelectcallsResultProjectionTest::testBuildInsertSelectcallsResultProjectionTest::testBuildInsertSetSelectcallsResultProjectionTest::testBuildInsertSourceSelectCastsDestinationColumnscallsInsertTransformerTestcallsMySqlTransformerTestcallsReplaceTransformerTestcalls
Relations§
Static calls 1
Type declarations 4
- type ZtdQuery\Platform\MySql\Rewrite\Transformer\Insert\ResultProjection packages/ztd-query-mysql/src/Rewrite/Transformer/Insert/ResultProjection.php:37
- type ZtdQuery\Platform\MySql\Rewrite\Transformer\Insert\ResultProjection packages/ztd-query-mysql/src/Rewrite/Transformer/Insert/ResultProjection.php:72
- type ZtdQuery\Platform\MySql\Rewrite\Transformer\Insert\ResultProjection packages/ztd-query-mysql/src/Rewrite/Transformer/Insert/ResultProjection.php:112
- type ZtdQuery\Platform\MySql\Rewrite\Transformer\Insert\ResultProjection packages/ztd-query-mysql/src/Rewrite/Transformer/Insert/ResultProjection.php:143