classCandidateKeyMatch
final class CandidateKeyMatch
Reads what a row carries in a candidate key, and tells when another row repeats it.
A candidate key only identifies a row when the row actually carries every column of it and carries something in each. SQL says a key with a null part collides with nothing, not even with itself, so a row that is missing a column or holds null there has no key values at all — which is a different answer from having key values that happen to be empty.
Type Aliases§
Row = import from TableDefinitionMethods§
Reads what a row carries in the named columns.
Parameters
$row | Row | Row to read |
$columns | array<int, string> | Columns the key is made of |
Returns
Row|null The values, keyed by column, or null when the row cannot be identified by this keyTest cases 4
CandidateKeyMatchTest::testOfAnswersNothingForAKeyMadeOfNoColumnscovers and callsCandidateKeyMatchTest::testOfAnswersNothingWhereTheRowLacksAKeyColumncovers and callsCandidateKeyMatchTest::testOfAnswersNothingWhereTheRowLeavesAKeyColumnNullcovers and callsCandidateKeyMatchTest::testOfReadsWhatTheRowCarriesInTheKeyColumnscovers and calls
Reports whether a row repeats these key values.
Returns
bool True when the row carries every one of them identicallyTest cases 2
CandidateKeyMatchTest::testCarriedByReportsARowRepeatingEveryValuecovers and callsCandidateKeyMatchTest::testCarriedByReportsARowThatDiffersInOneOfThemcovers and calls
Test cases 14§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
CandidateKeyMatchTest::testCarriedByReportsARowRepeatingEveryValuecovers and callsCandidateKeyMatchTest::testCarriedByReportsARowThatDiffersInOneOfThemcovers and callsCandidateKeyMatchTest::testOfAnswersNothingForAKeyMadeOfNoColumnscovers and callsCandidateKeyMatchTest::testOfAnswersNothingWhereTheRowLacksAKeyColumncovers and callsCandidateKeyMatchTest::testOfAnswersNothingWhereTheRowLeavesAKeyColumnNullcovers and callsCandidateKeyMatchTest::testOfReadsWhatTheRowCarriesInTheKeyColumnscovers and calls
Other tests reaching this symbol 8
CandidateKeySetTestcallsConflictSearchTestcallsMutationImpactTestcallsInsertMutationTestcallsReplaceMutationTestcallsSynchronizeMutationTestcallsUpsertMutationTestcallsShadowApplicationTestcalls