Does Prisma consider a transaction as one operation?
Is this one or two operations accoridng to Prisma for billing purposes?
1 Reply
You selected the bot's instantaneous insights. Let me compile your answer right away!
In Prisma, when you use an interactive transaction like this:
each query inside the interactive transaction is counted separately for billing purposes. So, in your example, this would count as two operations—one for the user creation and one for the password creation. The transaction itself (start, commit, rollback) is not billed, only the individual queries inside it are.
If you want the transaction to count as a single operation for billing, you would need to use the sequential operations form:
This array-based form counts as one billable query regardless of the number of operations inside the array. Interactive transactions, on the other hand, bill each query separately Are each of the queries within an interactive transaction counted separately for billing?.
✅ Great, thanks for letting us know that this solved your question!