New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(client): Implement isolation levels for batched transactions #15362
Merged
Conversation
This file contains 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
SevInf
commented
Sep 16, 2022
SevInf
commented
Sep 16, 2022
SevInf
commented
Sep 16, 2022
SevInf
commented
Sep 16, 2022
Tests are failing due to #15360 |
SevInf
force-pushed
the
batch-isolation-level
branch
from
September 16, 2022 15:35
29b3ac7
to
ba2b4bc
Compare
millsp
changed the title
feat(client): Implement isolation levels for bathc transactions
feat(client): Implement isolation levels for batched transactions
Sep 16, 2022
millsp
reviewed
Sep 16, 2022
millsp
reviewed
Sep 16, 2022
millsp
reviewed
Sep 16, 2022
millsp
reviewed
Sep 16, 2022
packages/client/src/runtime/core/request/createPrismaPromise.ts
Outdated
Show resolved
Hide resolved
millsp
reviewed
Sep 16, 2022
millsp
reviewed
Sep 16, 2022
@millsp I beleive it can now go for additional round of reviews, while I am working on engines |
SevInf
commented
Sep 19, 2022
millsp
approved these changes
Sep 19, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to go! Thanks for adding the missing tests
SevInf
force-pushed
the
batch-isolation-level
branch
5 times, most recently
from
September 20, 2022 13:13
9e86e88
to
fec107c
Compare
Engines part: prisma/prisma-engines#3199 Batch `$transaction` call will now receive optional options objects with `isolationLevel` property, allowing to pick any level, supporting by current transaction. Internally, refactors a bunch of things about the way transaction info is stored in `PrismaPromise`, `Request` and `InternalRequest` types. - All transaction-related properties are now grouped under `transaction` key. Distiction between iTx and batch transaction is done explcitly via discriminated union type. - `runInTransaction` property is removed from everywhere expcept middleware public APIs. `transaction` field now indicates that the request should run in transaction. For testing we are checking that engine correctly generates corresponding SQL. Properly testing different isolation level effects would be very difficult, especially in case of batch transactions, where we can not execute any code between the queries. Ref #9678
SevInf
force-pushed
the
batch-isolation-level
branch
from
September 20, 2022 13:41
fec107c
to
9ba009e
Compare
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.
Engines part: prisma/prisma-engines#3199
Batch
$transaction
call will now receive optional optionsobjects with
isolationLevel
property, allowing to pick any level,supporting by current transaction. Internally, refactors a bunch of
things about the way transaction info is stored in
PrismaPromise
,Request
andInternalRequest
types.All transaction-related properties are now grouped under
transaction
key. Distiction between iTx and batch transaction is done explcitly
via discriminated union type.
runInTransaction
property is removed. Emptytransaction
field nowmeans that request is not running in transaction.
For testing we are checking that engine correctly generates corresponding SQL.
Properly testing different isolation level effects would be very
difficult, especially in case of batch transactions, where we can not
execute any code between the queries.
Ref #9678