classUpsertExpression
final class UpsertExpression
A scalar expression from an UPSERT assignment, in no particular dialect.
Every dialect writes "the value that was already there" and "the value that
- was coming in" differently, so a parser reads its own spelling and builds one
of these; what the expression means is then worked out here, once, for all of them. What each operator means is left to the collaborator that owns it, so this is only the tree and the walk over it.
Type Aliases§
Row = import from TableDefinitionRowValue = import from TableDefinitionMethods§
public function __construct(
private UpsertExpressionKind $kind,
private UpsertLiteralSource $literal = new \ZtdQuery\Shadow\Mutation\Upsert\UpsertLiteral(null),
private UpsertColumnSource|null $columnSource = null,
private string|null $column = null,
private list<self> $operands = [],
private UpsertColumn $columns = new \ZtdQuery\Shadow\Mutation\Upsert\UpsertColumn(),
private UpsertTruth $truth = new \ZtdQuery\Shadow\Mutation\Upsert\UpsertTruth(),
private UpsertOperator $operators = new \ZtdQuery\Shadow\Mutation\Upsert\UpsertOperator(),
)Parameters
$kind | UpsertExpressionKind | What this node is |
$literal | UpsertLiteralSource | Value a literal stands for |
$columnSource | UpsertColumnSource|null | Which row a column is read from |
$column | string|null | Column a column node names |
$operands | list<self> | Nodes this one is written over |
$columns | UpsertColumn | Reads a column off a row |
$truth | UpsertTruth | Answers what counts as true |
$operators | UpsertOperator | Says what an operator stands for |
Calls 4
- new UpsertLiteral line 42
- new UpsertColumn line 46
- new UpsertTruth line 47
- new UpsertOperator line 48
public static function literal(mixed $value): selfBuilds an expression standing for a value written into the statement.
Parameters
$value | mixed | Value as the statement wrote it |
Returns
self The expressionTest cases 30
ConflictSearchTest::testOfIsNothingWhereTheIncomingRowTakesNoPartInTheNarrowedKeycallsConflictSearchTest::testOfLeavesOutTheRowsAlreadyThereThatTakeNoPartcallsConflictSearchTest::testOfReportsTheRowUnderTheKeyTheCallerKnowsItBycallsMutationImpactTest::testSkippedConditionalUpsertHasNoAffectedOrReturningRowscallsInsertMutationTest::testInsertIgnoreUsesPartialConflictPredicatecallsUpsertExpressionTest::testAcceptsFloatingPointOneAsDivisorcallsUpsertExpressionTest::testArithmeticFloatingPointBoundariescallsUpsertExpressionTest::testArithmeticIsNullWhereTheLeftOperandIsNullcallsUpsertExpressionTest::testArithmeticIsNullWhereTheRightOperandIsNullcallsUpsertExpressionTest::testBinaryAnswersWhatTheOperatorMakesOfItsTwoOperandscallsUpsertExpressionTest::testComparisonReturnsNullWhenEitherOperandIsNullcallsUpsertExpressionTest::testEvaluatesNullNumericTextAndCaseInsensitiveColumnBoundariescallsUpsertExpressionTest::testLiteralAnswersTheValueTheStatementWrotecallsUpsertExpressionTest::testLiteralPreservesAnOpaqueCallerValuecallsUpsertExpressionTest::testMatchesIsTrueOnlyWhereTheExpressionDefinitelyHoldscallsUpsertExpressionTest::testRejectsDivisionByZerocallsUpsertExpressionTest::testRejectsModuloByZerocallsUpsertExpressionTest::testRejectsNonNumericArithmeticOperandcallsUpsertExpressionTest::testRejectsNumericAndTextComparisoncallsUpsertExpressionTest::testThreeValuedBooleanBoundariescallsUpsertExpressionTest::testUnaryNegatesTheOperandcallsUpsertMutationTest::testApplyUsesConflictPredicateAndReportsOnlyAppliedRowscallsUpsertMutationTest::testApplyWithLiteralUpdateValuecallsUpsertMutationTest::testConflictPredicateRestrictsIncomingAndExistingCandidateRowscallsUpsertMutationTest::testDatabaseEvaluatedPredicateFallsBackWhenMetadataIsMissingcallsUpsertMutationTest::testResultRowsAnswersEveryRowTheStatementWroteOrLeftAsItWascallsUpsertMutationTest::testSkippedConditionalRowDoesNotStopFollowingRowscallsUpsertUpdateTest::testAppliesReadsTheConditionHereWhereTheDatabaseWorkedNothingOutcallsUpsertUpdateTest::testValueReadAnswersTheAssignmentZtdReadcallsUpsertUpdateTest::testWithColumnReadsTheExpressionAgainstTheRowAsTheStatementLeftItcalls
Called from 12
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parsePrimary() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:201
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parsePrimary() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:206
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parsePrimary() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:211
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parsePrimary() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:216
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrimaryParser::parsePrimary() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrimaryParser.php:50
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrimaryParser::parsePrimary() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrimaryParser.php:55
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrimaryParser::parsePrimary() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrimaryParser.php:60
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrimaryParser::parsePrimary() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrimaryParser.php:65
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\PrimaryExpressionParser::parsePrimary() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/PrimaryExpressionParser.php:48
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\PrimaryExpressionParser::parsePrimary() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/PrimaryExpressionParser.php:53
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\PrimaryExpressionParser::parsePrimary() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/PrimaryExpressionParser.php:58
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\PrimaryExpressionParser::parsePrimary() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/PrimaryExpressionParser.php:63
Calls 3
- new
selfline 61 - class-const UpsertExpressionKind::Literal() line 61
- new UpsertLiteral line 61
public static function column(UpsertColumnSource $source, string $column): selfBuilds an expression standing for a column of one of the two rows.
Parameters
$source | UpsertColumnSource | Whether the column is read from the existing row or the incoming one |
$column | string | Column as the statement named it |
Returns
self The expressionThrows
InvalidDefinitionException When no column was namedTest cases 22
ConflictSearchTest::testOfIsNothingWhereTheIncomingRowTakesNoPartInTheNarrowedKeycallsConflictSearchTest::testOfLeavesOutTheRowsAlreadyThereThatTakeNoPartcallsConflictSearchTest::testOfReportsTheRowUnderTheKeyTheCallerKnowsItBycallsMutationImpactTest::testSkippedConditionalUpsertHasNoAffectedOrReturningRowscallsInsertMutationTest::testInsertIgnoreUsesPartialConflictPredicatecallsUpsertExpressionTest::testColumnReadsTheSelectedRowAndColumncallsUpsertExpressionTest::testEvaluatesNullNumericTextAndCaseInsensitiveColumnBoundariescallsUpsertExpressionTest::testLiteralAnswersTheValueTheStatementWrotecallsUpsertExpressionTest::testOperandRefusesAColumnTheRowDoesNotCarrycallsUpsertMutationTest::testApplyAccumulatesExistingAndIncomingValuescallsUpsertMutationTest::testApplyAccumulatesSequentialConflictsAgainstLatestRowcallsUpsertMutationTest::testApplyUpdatesExistingRowOnUniqueKeyConflictcallsUpsertMutationTest::testApplyUsesConflictPredicateAndReportsOnlyAppliedRowscallsUpsertMutationTest::testApplyWithExcludedColumnReferencecallsUpsertMutationTest::testApplyWithExcludedQuotedColumnReferencecallsUpsertMutationTest::testApplyWithUpdateValuesExpressioncallsUpsertMutationTest::testConflictPredicateRestrictsIncomingAndExistingCandidateRowscallsUpsertMutationTest::testDatabaseEvaluatedBatchDetectsConflictsWithRowsInsertedEarlierInStatementcallsUpsertMutationTest::testDatabaseEvaluatedBatchReevaluatesAgainstLatestConflictRowcallsUpsertMutationTest::testDatabaseEvaluatedPredicateFallsBackWhenMetadataIsMissingcallsUpsertMutationTest::testSkippedConditionalRowDoesNotStopFollowingRowscallsUpsertUpdateTest::testWithColumnReadsTheExpressionAgainstTheRowAsTheStatementLeftItcalls
Called from 7
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseValuesReference() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:243
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseColumnReference() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:319
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseColumnReference() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:325
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrimaryParser::column() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrimaryParser.php:105
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrimaryParser::column() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrimaryParser.php:111
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\PrimaryExpressionParser::parseColumn() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/PrimaryExpressionParser.php:108
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\PrimaryExpressionParser::parseColumn() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/PrimaryExpressionParser.php:114
Calls 3
- new InvalidDefinitionException line 77
- new
selfline 80 - class-const UpsertExpressionKind::Column() line 80
public static function unary(UpsertExpressionKind $kind, self $operand): selfBuilds an expression written over one other.
Parameters
$kind | UpsertExpressionKind | Operator to apply |
$operand | self | Expression it is applied to |
Returns
self The expressionThrows
InvalidDefinitionException When the operator is not one written over a single operandTest cases 3
Called from 6
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseUnary() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:156
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseUnary() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:164
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseUnary() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:120
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseUnary() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:125
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\ArithmeticExpressionParser::parseUnary() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/ArithmeticExpressionParser.php:72
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\ArithmeticExpressionParser::parseUnary() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/ArithmeticExpressionParser.php:77
Calls 6
- function-call
in_arrayline 95 - class-const UpsertExpressionKind::UnaryPlus() line 96
- class-const UpsertExpressionKind::UnaryMinus() line 97
- class-const UpsertExpressionKind::Not() line 98
- new InvalidDefinitionException line 100
- new
selfline 103
public static function binary(UpsertExpressionKind $kind, self $left, self $right): selfBuilds an expression written between two others.
Parameters
$kind | UpsertExpressionKind | Operator to apply |
$left | self | Expression on its left |
$right | self | Expression on its right |
Returns
self The expressionThrows
InvalidDefinitionException When the operator is not one written between two operandsTest cases 28
ConflictSearchTest::testOfIsNothingWhereTheIncomingRowTakesNoPartInTheNarrowedKeycallsConflictSearchTest::testOfLeavesOutTheRowsAlreadyThereThatTakeNoPartcallsConflictSearchTest::testOfReportsTheRowUnderTheKeyTheCallerKnowsItBycallsMutationImpactTest::testSkippedConditionalUpsertHasNoAffectedOrReturningRowscallsInsertMutationTest::testInsertIgnoreUsesPartialConflictPredicatecallsUpsertExpressionTest::testAcceptsFloatingPointOneAsDivisorcallsUpsertExpressionTest::testArithmeticFloatingPointBoundariescallsUpsertExpressionTest::testArithmeticIsNullWhereTheLeftOperandIsNullcallsUpsertExpressionTest::testArithmeticIsNullWhereTheRightOperandIsNullcallsUpsertExpressionTest::testBinaryAnswersWhatTheOperatorMakesOfItsTwoOperandscallsUpsertExpressionTest::testComparisonReturnsNullWhenEitherOperandIsNullcallsUpsertExpressionTest::testEvaluatesNullNumericTextAndCaseInsensitiveColumnBoundariescallsUpsertExpressionTest::testLiteralAnswersTheValueTheStatementWrotecallsUpsertExpressionTest::testRejectsDivisionByZerocallsUpsertExpressionTest::testRejectsModuloByZerocallsUpsertExpressionTest::testRejectsNonNumericArithmeticOperandcallsUpsertExpressionTest::testRejectsNumericAndTextComparisoncallsUpsertExpressionTest::testThreeValuedBooleanBoundariescallsUpsertMutationTest::testApplyAccumulatesExistingAndIncomingValuescallsUpsertMutationTest::testApplyAccumulatesSequentialConflictsAgainstLatestRowcallsUpsertMutationTest::testApplyUsesConflictPredicateAndReportsOnlyAppliedRowscallsUpsertMutationTest::testConflictPredicateRestrictsIncomingAndExistingCandidateRowscallsUpsertMutationTest::testDatabaseEvaluatedBatchDetectsConflictsWithRowsInsertedEarlierInStatementcallsUpsertMutationTest::testDatabaseEvaluatedBatchReevaluatesAgainstLatestConflictRowcallsUpsertMutationTest::testDatabaseEvaluatedPredicateFallsBackWhenMetadataIsMissingcallsUpsertMutationTest::testSkippedConditionalRowDoesNotStopFollowingRowscallsUpsertUpdateTest::testAppliesReadsTheConditionHereWhereTheDatabaseWorkedNothingOutcallsUpsertUpdateTest::testWithColumnReadsTheExpressionAgainstTheRowAsTheStatementLeftItcalls
Called from 15
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseOr() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:34
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseAnd() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:57
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseComparison() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:83
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseAdditive() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:105
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseMultiplicative() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:132
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseOr() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:34
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseAnd() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:49
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseComparison() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:66
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseAdditive() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:79
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseMultiplicative() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:104
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\ArithmeticExpressionParser::parseAdditive() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/ArithmeticExpressionParser.php:33
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\ArithmeticExpressionParser::parseMultiplicative() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/ArithmeticExpressionParser.php:57
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\ComparisonExpressionParser::parseComparison() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/ComparisonExpressionParser.php:34
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\LogicalExpressionParser::parseOr() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/LogicalExpressionParser.php:32
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\LogicalExpressionParser::parseAnd() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/LogicalExpressionParser.php:46
Calls 8
- function-call
in_arrayline 119 - class-const UpsertExpressionKind::Literal() line 120
- class-const UpsertExpressionKind::Column() line 121
- class-const UpsertExpressionKind::UnaryPlus() line 122
- class-const UpsertExpressionKind::UnaryMinus() line 123
- class-const UpsertExpressionKind::Not() line 124
- new InvalidDefinitionException line 126
- new
selfline 129
Answers what the expression stands for, against the two rows in play.
Parameters
Returns
mixed The value the expression stands forThrows
UnsupportedSqlException When an operand is not something the operator can be applied toTest cases 1
Called from 1
Calls 8
- class-const UpsertExpressionKind::Literal() line 145
- method-call UpsertLiteralSource::value() line 146
- class-const UpsertExpressionKind::Column() line 148
- method-call UpsertColumn::of() line 149
- class-const UpsertColumnSource::Incoming() line 150
- method-call UpsertOperator::apply() line 155
- method-call UpsertExpression::operand() line 157
- function-call
countline 158
Reports whether the expression holds, as a condition would have to.
Unknown is not enough: a WHERE that cannot be shown to hold does not select the row, so only a definite true counts.
Parameters
Returns
bool True when the expression is definitely trueThrows
UnsupportedSqlException When an operand is not something the operator can be applied toCalls 2
- method-call UpsertTruth::of() line 178
- method-call UpsertExpression::evaluate() line 178
public function operand(
int $index,
Row $existingRow,
Row $incomingRow,
string $tableName,
): mixedAnswers what one of the operands stands for.
Parameters
Returns
mixed The value that operand stands forThrows
UnsupportedSqlException When an operand is not something the operator can be applied toPrivate surface 8§
Implementation details, listed for orientation only.
private UpsertExpressionKind $kindprivate UpsertLiteralSource $literal = new \ZtdQuery\Shadow\Mutation\Upsert\UpsertLiteral(null)private UpsertColumnSource|null $columnSource = nullprivate string|null $column = nullprivate list<self> $operands = []private UpsertColumn $columns = new \ZtdQuery\Shadow\Mutation\Upsert\UpsertColumn()private UpsertTruth $truth = new \ZtdQuery\Shadow\Mutation\Upsert\UpsertTruth()private UpsertOperator $operators = new \ZtdQuery\Shadow\Mutation\Upsert\UpsertOperator()Test cases 41§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 18
UpsertExpressionTest::testAcceptsFloatingPointOneAsDivisorcallsUpsertExpressionTest::testArithmeticFloatingPointBoundariescallsUpsertExpressionTest::testArithmeticIsNullWhereTheLeftOperandIsNullcallsUpsertExpressionTest::testArithmeticIsNullWhereTheRightOperandIsNullcallsUpsertExpressionTest::testBinaryAnswersWhatTheOperatorMakesOfItsTwoOperandscallsUpsertExpressionTest::testColumnReadsTheSelectedRowAndColumncallsUpsertExpressionTest::testComparisonReturnsNullWhenEitherOperandIsNullcallsUpsertExpressionTest::testEvaluatesNullNumericTextAndCaseInsensitiveColumnBoundariescallsUpsertExpressionTest::testLiteralAnswersTheValueTheStatementWrotecallsUpsertExpressionTest::testLiteralPreservesAnOpaqueCallerValuecallsUpsertExpressionTest::testMatchesIsTrueOnlyWhereTheExpressionDefinitelyHoldscallsUpsertExpressionTest::testOperandRefusesAColumnTheRowDoesNotCarrycallsUpsertExpressionTest::testRejectsDivisionByZerocallsUpsertExpressionTest::testRejectsModuloByZerocallsUpsertExpressionTest::testRejectsNonNumericArithmeticOperandcallsUpsertExpressionTest::testRejectsNumericAndTextComparisoncallsUpsertExpressionTest::testThreeValuedBooleanBoundariescallsUpsertExpressionTest::testUnaryNegatesTheOperandcalls
Other tests reaching this symbol 23
ConflictSearchTest::testOfIsNothingWhereTheIncomingRowTakesNoPartInTheNarrowedKeycallsConflictSearchTest::testOfLeavesOutTheRowsAlreadyThereThatTakeNoPartcallsConflictSearchTest::testOfReportsTheRowUnderTheKeyTheCallerKnowsItBycallsMutationImpactTest::testSkippedConditionalUpsertHasNoAffectedOrReturningRowscallsInsertMutationTest::testInsertIgnoreUsesPartialConflictPredicatecallsUpsertLiteralSourceTest::testValueFlowsIntoAnExpressionWithoutCoercioncallsUpsertMutationTest::testApplyAccumulatesExistingAndIncomingValuescallsUpsertMutationTest::testApplyAccumulatesSequentialConflictsAgainstLatestRowcallsUpsertMutationTest::testApplyUpdatesExistingRowOnUniqueKeyConflictcallsUpsertMutationTest::testApplyUsesConflictPredicateAndReportsOnlyAppliedRowscallsUpsertMutationTest::testApplyWithExcludedColumnReferencecallsUpsertMutationTest::testApplyWithExcludedQuotedColumnReferencecallsUpsertMutationTest::testApplyWithLiteralUpdateValuecallsUpsertMutationTest::testApplyWithUpdateValuesExpressioncallsUpsertMutationTest::testConflictPredicateRestrictsIncomingAndExistingCandidateRowscallsUpsertMutationTest::testDatabaseEvaluatedBatchDetectsConflictsWithRowsInsertedEarlierInStatementcallsUpsertMutationTest::testDatabaseEvaluatedBatchReevaluatesAgainstLatestConflictRowcallsUpsertMutationTest::testDatabaseEvaluatedPredicateFallsBackWhenMetadataIsMissingcallsUpsertMutationTest::testResultRowsAnswersEveryRowTheStatementWroteOrLeftAsItWascallsUpsertMutationTest::testSkippedConditionalRowDoesNotStopFollowingRowscallsUpsertUpdateTest::testAppliesReadsTheConditionHereWhereTheDatabaseWorkedNothingOutcallsUpsertUpdateTest::testValueReadAnswersTheAssignmentZtdReadcallsUpsertUpdateTest::testWithColumnReadsTheExpressionAgainstTheRowAsTheStatementLeftItcalls
Relations§
Static calls 40
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseOr() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:34
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseAnd() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:57
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseComparison() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:83
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseAdditive() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:105
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseMultiplicative() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:132
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseUnary() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:156
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseUnary() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:164
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parsePrimary() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:201
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parsePrimary() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:206
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parsePrimary() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:211
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parsePrimary() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:216
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseValuesReference() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:243
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseColumnReference() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:319
- static-call ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader::parseColumnReference() packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:325
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseOr() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:34
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseAnd() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:49
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseComparison() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:66
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseAdditive() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:79
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseMultiplicative() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:104
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseUnary() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:120
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser::parseUnary() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:125
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrimaryParser::parsePrimary() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrimaryParser.php:50
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrimaryParser::parsePrimary() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrimaryParser.php:55
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrimaryParser::parsePrimary() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrimaryParser.php:60
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrimaryParser::parsePrimary() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrimaryParser.php:65
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrimaryParser::column() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrimaryParser.php:105
- static-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrimaryParser::column() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrimaryParser.php:111
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\ArithmeticExpressionParser::parseAdditive() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/ArithmeticExpressionParser.php:33
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\ArithmeticExpressionParser::parseMultiplicative() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/ArithmeticExpressionParser.php:57
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\ArithmeticExpressionParser::parseUnary() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/ArithmeticExpressionParser.php:72
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\ArithmeticExpressionParser::parseUnary() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/ArithmeticExpressionParser.php:77
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\ComparisonExpressionParser::parseComparison() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/ComparisonExpressionParser.php:34
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\LogicalExpressionParser::parseOr() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/LogicalExpressionParser.php:32
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\LogicalExpressionParser::parseAnd() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/LogicalExpressionParser.php:46
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\PrimaryExpressionParser::parsePrimary() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/PrimaryExpressionParser.php:48
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\PrimaryExpressionParser::parsePrimary() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/PrimaryExpressionParser.php:53
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\PrimaryExpressionParser::parsePrimary() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/PrimaryExpressionParser.php:58
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\PrimaryExpressionParser::parsePrimary() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/PrimaryExpressionParser.php:63
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\PrimaryExpressionParser::parseColumn() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/PrimaryExpressionParser.php:108
- static-call ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\PrimaryExpressionParser::parseColumn() packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/PrimaryExpressionParser.php:114
Type declarations 41
- type ZtdQuery\Shadow\Mutation\ConflictSearch packages/ztd-query-core/src/Shadow/Mutation/ConflictSearch.php:30
- type ZtdQuery\Shadow\Mutation\Row\InsertMutation packages/ztd-query-core/src/Shadow/Mutation/Row/InsertMutation.php:60
- type ZtdQuery\Shadow\Mutation\Row\InsertMutation packages/ztd-query-core/src/Shadow/Mutation/Row/InsertMutation.php:84
- type ZtdQuery\Shadow\Mutation\UpsertMutation packages/ztd-query-core/src/Shadow/Mutation/UpsertMutation.php:50
- type ZtdQuery\Shadow\Mutation\UpsertMutation packages/ztd-query-core/src/Shadow/Mutation/UpsertMutation.php:52
- type ZtdQuery\Shadow\Mutation\UpsertMutation packages/ztd-query-core/src/Shadow/Mutation/UpsertMutation.php:82
- type ZtdQuery\Shadow\Mutation\UpsertMutation packages/ztd-query-core/src/Shadow/Mutation/UpsertMutation.php:86
- type ZtdQuery\Shadow\Mutation\UpsertUpdate packages/ztd-query-core/src/Shadow/Mutation/UpsertUpdate.php:43
- type ZtdQuery\Shadow\Mutation\UpsertUpdate packages/ztd-query-core/src/Shadow/Mutation/UpsertUpdate.php:190
- type ZtdQuery\Shadow\Mutation\UpsertUpdate packages/ztd-query-core/src/Shadow/Mutation/UpsertUpdate.php:209
- type ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:24
- type ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:47
- type ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:70
- type ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:93
- type ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:118
- type ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:145
- type ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:177
- type ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:230
- type ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\ExpressionReader packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/ExpressionReader.php:299
- type ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\MySqlUpsertExpressionParser packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/MySqlUpsertExpressionParser.php:21
- type ZtdQuery\Platform\MySql\Shadow\Mutation\Upsert\MySqlUpsertExpressionParser packages/ztd-query-mysql/src/Shadow/Mutation/Upsert/MySqlUpsertExpressionParser.php:36
- type ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:29
- type ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:44
- type ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:59
- type ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:73
- type ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:93
- type ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrecedenceParser packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrecedenceParser.php:114
- type ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrimaryParser packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrimaryParser.php:31
- type ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\Expression\PrimaryParser packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/Expression/PrimaryParser.php:89
- type ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\PgSqlUpsertExpressionParser packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/PgSqlUpsertExpressionParser.php:21
- type ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\PgSqlUpsertExpressionParser packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/PgSqlUpsertExpressionParser.php:39
- type ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\ArithmeticExpressionParser packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/ArithmeticExpressionParser.php:27
- type ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\ArithmeticExpressionParser packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/ArithmeticExpressionParser.php:46
- type ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\ArithmeticExpressionParser packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/ArithmeticExpressionParser.php:66
- type ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\ComparisonExpressionParser packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/ComparisonExpressionParser.php:27
- type ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\LogicalExpressionParser packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/LogicalExpressionParser.php:27
- type ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\LogicalExpressionParser packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/LogicalExpressionParser.php:41
- type ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\PrimaryExpressionParser packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/PrimaryExpressionParser.php:29
- type ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\PrimaryExpressionParser packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/PrimaryExpressionParser.php:88
- type ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\SqliteUpsertExpressionParser packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/SqliteUpsertExpressionParser.php:20
- type ZtdQuery\Platform\Sqlite\Shadow\Mutation\Upsert\SqliteUpsertExpressionParser packages/ztd-query-sqlite/src/Shadow/Mutation/Upsert/SqliteUpsertExpressionParser.php:38