/prisma-unit-of-work

DDD, Unit of work pattern for Typescript, Nest.js, Prisma ⚡

Primary LanguageTypeScriptMIT LicenseMIT

Unit of work pattern for PrismaORM

return this.unitOfWork.runInTransaction(async (tx) => {
  const updatedAggregate1 = await this.repo.saveAggregate1(entity, { tx });
  await this.repo2.saveAggregate2(entity, { tx });
  return updatedAggregate1;
});

image