classConflictSearch
final class ConflictSearch
Finds the row an incoming row would collide with, where a clause narrows which.
A partial index and a conflict target both say that only some rows take part in a collision. Where a statement names one, a row that does not satisfy it collides with nothing, and neither do the rows already there that do not.
Type Aliases§
Row = import from TableDefinitionMethods§
public function __construct(
private CandidateKeySet $candidateKeys,
private UpsertExpression|null $predicate,
private string $tableName,
)Parameters
$candidateKeys | CandidateKeySet | Keys a collision could be on |
$predicate | UpsertExpression|null | What narrows which rows take part, or null when nothing does |
$tableName | string | Table being written to |
Test cases 5
ConflictSearchTest::testOfAnswersTheRowTheIncomingRowWouldCollideWithcoversConflictSearchTest::testOfIsNothingWhereNoRowAlreadyThereCarriesTheSameKeycoversConflictSearchTest::testOfIsNothingWhereTheIncomingRowTakesNoPartInTheNarrowedKeycoversConflictSearchTest::testOfLeavesOutTheRowsAlreadyThereThatTakeNoPartcoversConflictSearchTest::testOfReportsTheRowUnderTheKeyTheCallerKnowsItBycovers
public function of(Row $row, array<int, Row> $existingRows): CandidateKeyConflict|nullAnswers the row an incoming row would collide with, if any.
Returns
CandidateKeyConflict|null Where and on which key it collides, or null when it does notThrows
UnsupportedSqlException When the narrowing clause cannot be worked out for a rowTest cases 5
ConflictSearchTest::testOfAnswersTheRowTheIncomingRowWouldCollideWithcovers and callsConflictSearchTest::testOfIsNothingWhereNoRowAlreadyThereCarriesTheSameKeycovers and callsConflictSearchTest::testOfIsNothingWhereTheIncomingRowTakesNoPartInTheNarrowedKeycovers and callsConflictSearchTest::testOfLeavesOutTheRowsAlreadyThereThatTakeNoPartcovers and callsConflictSearchTest::testOfReportsTheRowUnderTheKeyTheCallerKnowsItBycovers and calls
Called from 2
Calls 1
- method-call CandidateKeySet::findConflict() line 48
Private surface 3§
Implementation details, listed for orientation only.
private CandidateKeySet $candidateKeysprivate UpsertExpression|null $predicateprivate string $tableNameTest cases 14§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
ConflictSearchTest::testOfAnswersTheRowTheIncomingRowWouldCollideWithcovers and callsConflictSearchTest::testOfIsNothingWhereNoRowAlreadyThereCarriesTheSameKeycovers and callsConflictSearchTest::testOfIsNothingWhereTheIncomingRowTakesNoPartInTheNarrowedKeycovers and callsConflictSearchTest::testOfLeavesOutTheRowsAlreadyThereThatTakeNoPartcovers and callsConflictSearchTest::testOfReportsTheRowUnderTheKeyTheCallerKnowsItBycovers and calls
Other tests reaching this symbol 9
RewritePlanTestcallsSessionTestcallsMutationImpactTestcallsInsertMutationTestcallsShadowMutationTestcallsUpsertMutationTestcallsReferentialIntegrityEnforcerTestcallsShadowApplicationTestcallsStatementSimulatorTestcalls