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

Docs Transaction: Clear documentation on when a query (promise) can be created and used in a Txn #5815

Closed
richard-stafflink opened this issue Apr 5, 2024 · 2 comments
Labels
docs Documentation creation, updates or corrections

Comments

@richard-stafflink
Copy link

richard-stafflink commented Apr 5, 2024

It is unclear of when a promise (query or mutation) can be created that we want included in a trasaction.
When a promise is created, it is most comment for the I/O call to be made immediately.
I'm hoping this is not the case for Prisma queries/mutation (just like GQL dataloaders).

There was an old issue discussing clarification back in V3, and the result was the Prisma doco being updated: prisma/prisma#13564 (reply in thread)

Since then, and a few versions of the doco later, this info is missing.

So it would be nice to update the doco if this is still the case.

NOTE: in order for the promise to only fire when await/then, and not immediately, there would have to be a process.nextTick() (or a zero setTimeout)` - does that sound right?

@richard-stafflink richard-stafflink added the docs Documentation creation, updates or corrections label Apr 5, 2024
@richard-stafflink richard-stafflink changed the title Transaction: clear document on when a query (promise) can be created and used in a Txn Docs Transaction: Clear documentation on when a query (promise) can be created and used in a Txn Apr 5, 2024
@janpio
Copy link
Contributor

janpio commented Apr 5, 2024

This might be relevant here: https://www.prisma.io/docs/orm/reference/prisma-client-reference#prismapromise-behavior

@nikolasburk
Copy link
Member

Hey @richard-stafflink, it seems like your question has been addressed by the link Jan shared earlier.

If you feel like we still need to update the docs, please feel free to re-open the issue 🙏

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation creation, updates or corrections
Projects
None yet
Development

No branches or pull requests

3 participants