Transactions and Subscribers — Techniques · NestJS

Make an adoption all-or-nothing with dataSource.transaction() and its explicit QueryRunner form, and tidy every cat's name before it is written with an entity subscriber.

What you will learn

Read the theory for Transactions and Subscribers

All Techniques lessons

All NestJS courses

loading types…

What you'll learn

  • Run several writes as one transaction with dataSource.transaction() and explain why only the manager it hands over is inside it
  • Write the explicit QueryRunner form: connect, start, commit or roll back, release in finally
  • Register an entity subscriber as a provider and change an entity in a before hook, whoever inserts it