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

tableName used to construct the projected row.

public list<string> $tableColumns

tableColumns used to construct the projected row.

public list<string> $insertColumns

insertColumns used to construct the projected row.

public array<string, ColumnDeclaration> $columnTypes

columnTypes used to construct the projected row.

public array<string, string> $columnDefaults

columnDefaults used to construct the projected row.

public array<string, IdentityGenerationStrategy> $identityStrategies

identityStrategies used to construct the projected row.

public array<int, array<string, int|string>> $existingRows

existingRows used to construct the projected row.

public array<string, array<int, string>> $candidateKeys

candidateKeys 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

$tableNamestring
$tableColumnslist<string>
$insertColumnslist<string>
$columnTypesarray<string, ColumnDeclaration>
$columnDefaultsarray<string, string>
$identityStrategiesarray<string, IdentityGenerationStrategy>
$existingRowsarray<int, array<string, int|string>>
$candidateKeysarray<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,
): self

Parameters

$statementInsertStatement
$tablesarray<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>>}>
$sqlstring

Returns

self
Test cases 2
Called from 1
Calls 5

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

Relations§

Static calls 1
Type declarations 4