Skip to content
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

Feature/transaction support #90

Merged
merged 6 commits into from
May 30, 2023
Merged

Conversation

YutaUra
Copy link
Contributor

@YutaUra YutaUra commented May 24, 2023

I wrote an implementation to support transaction rollback using SAVEPOINT

Let me first say that the implementation is not yet perfect.
I believe the implementation is complete. I've added a test case, so I'm thinking it's probably okay.

I have confirmed that the test case I added succeeds when using sqlite.
I have tried testing with Postgres instead of SQLite and have confirmed that it succeeds.
↓ This is its code.
YutaUra#1


If you don't mind, I'd like to get your feedback on the changes at this time.

@YutaUra YutaUra changed the title 🚧 Feature/transaction support Feature/transaction support May 25, 2023
@YutaUra
Copy link
Contributor Author

YutaUra commented May 25, 2023

@Quramy I think I've got it all implemented. I would love to have your review! ❤️

@Quramy
Copy link
Owner

Quramy commented May 30, 2023

Hi. Thanks for your PR.

I think this feature should remain disabled by default .

  1. Currently Prisma's $transaction does not support nested transaction, Support "nested" transactions in interactive transactions prisma/prisma#15212. How Prisma itself supports nested transactions will change the positioning of this feature. In this sense, I think this feature is experimental.
  2. $executeRawUnsafe("SAVEPOINT ...") might not work at NOSQL datasource environment.

Would you reverse the disableReproduceTransactionRollback flag ? (i.e. enableExperimentalRollbackInTransaction )

@YutaUra
Copy link
Contributor Author

YutaUra commented May 30, 2023

@Quramy Thanks so much for the review, I really appreciate it. I agree with your feedback!

I pushed the fixed code. Please feel free to tell me if you find anything that needs to be fixed!

@Quramy
Copy link
Owner

Quramy commented May 30, 2023

@YutaUra Thanks, great work 🎉

@Quramy Quramy merged commit 2df3678 into Quramy:main May 30, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants