title: NestJS+TypeORM - Access Repo from Subscriber (trying to imitate Triggers)
body: <p>I'm on my first projet using NestJS and I'm a bit confused.</p>
  <p>I have 2 entities: <code>Account</code> and <code>Transaction</code></p>
  <p>how should I implement a way to update <code>Account.balance</code> on changes (Create, Update, Delete) in <code>Transactions</code></p>
  <p>Looks like I should create a <code>TransactionsSubscriber</code> but there I can't seem to access DB connection.</p>
  <p>Subscribers are loaded in the <code>ormconfig.json</code></p>
  <p>I feel I'm missing out something obvious, but I've been stuck there for too long. Please someone help me out.</p>
  <pre class="lang-js prettyprint-override"><code>@EventSubscriber()
  export class TransactionsSubscriber
    implements EntitySubscriberInterface&lt;TransactionEntity&gt; {
    constructor(
      @InjectConnection('Account') readonly connection: Connection,
      @InjectRepository(TransactionEntity) transactionsRepo: Repository&lt;TransactionEntity&gt;,
      // @InjectEventEmitter() private emitter: AppEventEmitter,
      @Inject(REQUEST) private readonly request,
    ) {
      // connection.subscribers.push(this);
      console.log(
        typeof connection, // &lt;=== ** here it returns me undefined **
        typeof transactionsRepo // and here too
        //, typeof emitter
      );
    }
  
    /**
     * Indicates that this subscriber only listen to TransactionEntity events.
     */
    listenTo() {
      return TransactionEntity;
    }
  
    afterInsert(event: InsertEvent&lt;TransactionEntity&gt;) {
      console.log(`After Transaction INSERTED: `, event.entity);
    }
  }
  </code></pre>