adamjkb / bark

Materialized path extension for Prisma
https://prisma-extension-bark.gitbook.io
MIT License
33 stars 5 forks source link

Use $transactions instead of Promise.all #18

Closed adamjkb closed 11 months ago

adamjkb commented 1 year ago

According to the latest documentation on prisma extension you can use $transactions like this: https://www.prisma.io/docs/concepts/components/prisma-client/client-extensions/shared-extensions#call-a-client-level-method-from-your-packaged-extension

Which means that we can either bind the client.$transactions to each model so we can call it from the function without having to frakenstein it into each function. Technically this would create a callable function on the user-facing API. But it might be justifiable.

adamjkb commented 1 year ago

Implementing this would also remove the need to mention SQLite connection_limit. At least in the limited testing I've done, that seem to have been solved by it.