final class InsertMutation
    implements DataMutation

Applies INSERT result rows to the shadow store.

Type Aliases§

Row = import from TableDefinition

Methods§

public function __construct(
    string $tableName,
    array<int, string> $primaryKeys = [],
    bool $ignore = false,
    TableDefinition|null $tableDefinition = null,
    string $sql = '',
    bool $validateConstraints = false,
    CandidateKeySet|null $candidateKeys = null,
    UpsertExpression|null $conflictPredicate = null,
)

Parameters

$tableNamestringTarget table.
$primaryKeysarray<int, string>Primary key columns.
$ignoreboolWhether to ignore duplicates (INSERT IGNORE).
$tableDefinitionTableDefinition|nullTable definition for constraint validation.
$sqlstringOriginal SQL statement for exception messages.
$validateConstraintsboolWhether to validate constraints.
$candidateKeysCandidateKeySet|nullCandidate keys used for duplicate detection.
$conflictPredicateUpsertExpression|nullCondition that controls candidate-key eligibility.
Test cases 20
Calls 3
public function apply(ShadowStore $store, array $rows): void

{@inheritDoc}

Parameters

$storeShadowStore
$rowsarray

Throws

DuplicateKeyException When a row would collide with one already there on a candidate key
Test cases 27
Calls 6

Private surface 9§

Implementation details, listed for orientation only.

private string $tableName
private bool $ignore
private TableDefinition|null $tableDefinition
private string $sql
private bool $validateConstraints
private CandidateKeySet $candidateKeys
private ?UpsertExpression $conflictPredicate
private RowConstraints $constraints
private ConflictSearch $conflicts

Test cases 55§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 12
Other tests reaching this symbol 43

Relations§

Constant reads 1
Type checks 1