In this post, we will look at how to perform a NestJS TypeORM Transaction using the TypeORM QueryRunner class with examples. This is also the recommended …
Join the DZone community and get the full member experience. In this post, we will look at how to perform a NestJS TypeORM Transaction using the TypeORM QueryRunner class. This is also the recommended way of handling transactions in NestJS. If you are new to using TypeORM with NestJS, refer to this detailed post about NestJS TypeORM Integration. Transactions are one of the most important concepts while dealing with databases. Basically, a transaction is a unit of work. We should treat it as a whole. Either it happens completely or it does not happen. For example, you can think of transferring money from one account to another.