4 ms·
I mentioned this the last time, but I find it surprising that the Prisma ORM doesn't support transactions or aggregations? Any thoughts from the Prisma team? I
by hn_reddit_human 6y ago
I mentioned this the last time, but I find it surprising that the Prisma ORM doesn't support transactions or aggregations?
Any thoughts from the Prisma team? It kind of seems like table stakes. I commented on this previously as well: https://news.ycombinator.com/item?id=23467427 https://news.ycombinator.com/item?id=23467427
- Sujan 6y agoThis time I can answer that some aggregations are in the current milestone: https://github.com/prisma/prisma/issues/2838 https://github.com/prisma/prisma/issues/2838 That could mean they will be available very soon. (If you are missing any other ones, please comment on that issue or create a new one!) Transactions were actually included in the last release https://github.com/prisma/prisma/releases/tag/2.1.0 https://github.com/prisma/prisma/releases/tag/2.1.0 (search for `transactionApi`) in a specific form behind a feature flag (batch transactions, not long running transactions).
- lukeholder 6y agoBefore I could consider Prisma, it would need to support full transactions: https://github.com/prisma/prisma/issues/1844 https://github.com/prisma/prisma/issues/1844
- lukeholder 6y agoHow could I write any serious ecommerce/financial product with Prisma without transactions? Thats is crazy. Sticking with Postgres and plain ol' SQL!
- sorenbs 6y agoPrisma supports transactions through the `prisma.transaction` API. This allow you to perform multiple DB actions in a single request and gives you an all-or-nothing semantic.
- hn_reddit_human 6y agoThanks! IIUC, a "batch" request is run in a transaction.But if I need to run business logic in the middle of requests that's not supported?
- hervelabas 6y agoNot yet indeed. Prisma doesn't support long running transactions and advocates for alternative ways. We're preparing a post on the topic soon, and will improve the means for those alternatives.