aqrln
PPrisma
•Created by deanStealth on 1/8/2025 in #help-and-questions
Prisma Promises not transferring context like Promises?
Hi @deanStealth, Prisma promises work fine with AsyncLocalStorage — otherwise tracing wouldn’t be able to function. As @wmadden wrote above, they don't do anything too fancy and "just work" like any other async operation, modulo deferring the execution until a
then
handler is attached. The actual problem here is that you assume that SQL log events are emitted in the same async context as the Prisma query itself, which is unfortunately not the case. They are emitted independently, and may even be emitted after the Prisma operation had already been finished.13 replies