ExpressJs Transactions

Is there a best practices or best way to wrap all requests to an ExpressJS API server in a transaction. I would like to start a transaction for any request going to /api and then either commit on successfully return or rollback if an error occurs. If possible I would like this to be as transparent as possible. Is such a thing possible? Thanks!
2 Replies
Prisma AI Help
You selected the carefully hand-crafted route. A dev artisan will respond soon. Meanwhile, the #ask-ai channel awaits if you're curious!
Nurul
Nurul4d ago
This should be possible by using a Prisma Client Extensions. There are several examples here: https://github.com/prisma/prisma-client-extensions Though not exactly similar to what you are trying to achieve.
GitHub
GitHub - prisma/prisma-client-extensions: Examples of Prisma Client...
Examples of Prisma Client extensions. Contribute to prisma/prisma-client-extensions development by creating an account on GitHub.

Did you find this page helpful?