Cross Module Transaction with Prisma

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • Appwrite - The Open Source Firebase alternative introduces iOS support
  • Scout APM - Less time debugging, more time building
  • SonarQube - Static code analysis for 29 languages.
  • prisma-auto-transaction-poc

    Here's some sample codes

  • Prisma

    Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB

    // copied from official docs https://www.prisma.io/docs/concepts/components/prisma-client/transactions#batchbulk-operations await prisma.$transaction(async (prisma) => { // 1. Decrement amount from the sender. const sender = await prisma.account.update({ data: { balance: { decrement: amount, }, }, where: { email: from, }, }); // 2. Verify that the sender's balance didn't go below zero. if (sender.balance < 0) { throw new Error(`${from} doesn't have enough to send ${amount}`); } // 3. Increment the recipient's balance by amount const recipient =

  • Appwrite

    Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts