-
Notifications
You must be signed in to change notification settings - Fork 245
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
fix(driver-adapters): PlanetScale transactions #4967
Conversation
…mpacting PlanetScale
…ma-engines into fix/planetscale-transactions
CodSpeed Performance ReportMerging #4967 will not alter performanceComparing Summary
|
WASM Query Engine file Size
|
…: retrigger CI/CD
} | ||
|
||
#[async_trait] | ||
impl Queryable for JsTransactionContext { |
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.
It's kind of a slippery slope but I really feel like implementing Deref
is appropriate in these cases. Let's not do it in this PR to avoid churning unrelated code, but I'd strongly consider doing it later. Others may disagree though.
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.
Although I was sceptical at fist, after thinking about it a bit more I agree that it's an appropriate abstraction. We still have a kind of typestate pattern (i.e. TransactionContext
doesn't have methods like commit
/rollback
, you need to call start_transaction
to get access to them) while the Queryable
trait represents another dimension and is orthogonal to those methods.
While ideally I would still prefer to have tighter interfaces or push more logic to the driver adapter without going back and forth between JS and Rust so much, that would be a big refactoring, while this PR is indeed a good solution based on the abstractions we have.
This PR deprecates #4966.
This PR:
Companion TypeScript PR: prisma/prisma#24878.
Please refer to the explanations therein about
TransactionContext
.