question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EventSubscriber not getting updated values for update using queryBuilder and manager.update methods.

See original GitHub issue

Issue type:

[x] question [ ] bug report [ ] feature request [ ] documentation issue

Database system/driver:

[ ] cordova [ ] mongodb [ ] mssql [ ] mysql / mariadb [ ] oracle [x] postgres [ ] sqlite [ ] sqljs [ ] react-native

TypeORM version:

[ ] latest [ ] @next [ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem: Whenever entity is update using queryBuilder update method or entity update method, the EventSubscriber’s afterUpdate method gets triggered, but the UpdateEvents entity, databaseEntity, updatedColumns, updateRelations are always empty. These fields are populated only when the updates are done using save methods. Is this intended behaviour.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:7
  • Comments:22 (5 by maintainers)

github_iconTop GitHub Comments

102reactions
pleerockcommented, Jun 4, 2018

TypeORM is huge and has lot of small functionality and lot of quirks. There are hundred such small details all of them simply can’t be documented not only because its impossible to keep in mind all small facts like this, but also because it will complicate documentation. Maybe I’ll add this to documentation in the future.

68reactions
pleerockcommented, Feb 25, 2019

wow, wow so many dislikes on my above post ^ Okay, okay, now I definitely know we need to add this to the docs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Queries in AfterUpdate are not working as expected in ...
I solved it by committing the current transaction (so the data is saved to the database) and starting a new transaction, so TypeORM...
Read more >
Entity Listeners and Subscribers - typeorm - GitBook
Any of your entities can have methods with custom logic that listen to specific entity events. You must mark those methods with special...
Read more >
TypeORM Entity Listeners — Exploring Best Practices and ...
Events are firing using QueryBuilder and repository/manager methods. To create a Subscriber , you need to: Mark the class with the @EventSubscriber decorator....
Read more >
0.3.7 (2022-06-29) | TypeORM Docs
Overall find* and count* method signatures where changed, read the ... NOTE: FOR UPDATE locking does not work with findOne in Oracle since...
Read more >
TypeORM - Quick Guide - Tutorialspoint
Easily insert, update and delete object in the database. ... CreateConnection method is provided by TypeORM to create a new connection.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found