Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zhuravlevma/prisma-unit-of-work

DDD, Unit of work pattern for Typescript, Nest.js, Prisma ⚡
https://github.com/zhuravlevma/prisma-unit-of-work

ddd ddd-patterns javascript nest nestjs orm prisma prisma-client prisma-orm typescript unit-of-work unit-of-work-pattern

Last synced: about 2 hours ago
JSON representation

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

Awesome Lists containing this project

README

        

# Unit of work pattern for PrismaORM

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

![image](https://github.com/zhuravlevma/prisma-unit-of-work/assets/44276887/6ebd10bd-fd88-42cb-8c7c-71a162283e04)