EventSubscriber not getting updated values for update using queryBuilder and manager.update methods.
See original GitHub issueIssue 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:
- Created 5 years ago
- Reactions:7
- Comments:22 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
wow, wow so many dislikes on my above post ^ Okay, okay, now I definitely know we need to add this to the docs.