Return Long from Update run/updateMany via executeLargeUpdate - #2480
Open
mwisnicki wants to merge 3 commits into
Open
Return Long from Update run/updateMany via executeLargeUpdate#2480mwisnicki wants to merge 3 commits into
mwisnicki wants to merge 3 commits into
Conversation
Update#run, Update0#run, updateMany, and their *AlteringExecution variants now return ConnectionIO[Long] instead of ConnectionIO[Int], using JDBC's executeLargeUpdate/executeLargeBatch. This avoids overflow when more than 2^31 rows are affected. This is a breaking change targeted for 1.0. Fixes typelevel#2479 Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
Author
|
I've reviewed all the changes |
yolo.scala's Update0YoloOps.quick shows the update count via Show, so switching the count from Int to Long makes cats.instances.int unused (fatal under tpolecatCiMode) and requires cats.instances.long instead. Co-Authored-By: Claude <noreply@anthropic.com>
Update#run and updateMany now invoke executeLargeUpdate/executeLargeBatch, so TracedInterpreter emits spans named executeLargeUpdate/executeLargeBatch (the interpreter already overrode these). Update TracedTransactorSuite's expected span names and db.operation.name attributes to match. Co-Authored-By: Claude <noreply@anthropic.com>
mwisnicki
commented
Jul 20, 2026
Author
|
Also I expected MiMa to fail but looks like the MiMa step is not really checking anything? |
Collaborator
|
@mwisnicki Yes MiMa is disabled until we reach 1.0 which is why there's not failure here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Update#run,Update0#run,updateMany, and their*AlteringExecutionvariants now returnConnectionIO[Long]instead ofConnectionIO[Int], using JDBC'sexecuteLargeUpdate/executeLargeBatch. This avoids overflow when more than 2^31 rows are affected.Fixes #2479
Details
modules/core/.../util/update.scala— switchedexecuteUpdate→executeLargeUpdateandexecuteBatch→executeLargeBatch; return types and thePreparedExecutionWithoutProcessSteptype parameters changed fromInttoLong. The free algebra already providedexecuteLargeUpdate/executeLargeBatch.Int(tests, examples, and mdoc docs).Breaking change
This is a source- and binary-breaking change to the
Update/Update0execution API. Per the issue discussion, targeting it for 1.0 (#1728) rather than adding a separaterunLargemethod.Testing
core/test— all passing (H2 in-memory)postgres/test— all passing (exercises realexecuteLargeUpdate/executeLargeBatch)mysql/test— all passingGenerated with Claude Code