You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)
Steps to reproduce or a small repository showing the problem:
I am using TypeORM with NestJS. I have a subscriber implementing the EntitySubscriberInterface, specifically the afterInsert. When inserting multiple values at once using repository.insert(values), the afterInsert is called as many times as the values, but the attached entity is always the first of them. I have not found any other way to retrieve the entities inserted.
The text was updated successfully, but these errors were encountered:
After some investigation, the InsertResult from repository.insert(values) itself contains an array with the same generated map multiple times. The SELECT query performed after the insert uses the first id as well, so that's causing the issue.
This does not occur in repository.save operations.
Issue type:
[x] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]
mongodb
[ ]
mssql
[x]
mysql
/mariadb
[ ]
oracle
[ ]
postgres
[ ]
cockroachdb
[ ]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[x]
latest
[ ]
@next
[ ]
0.x.x
(or put your version here)Steps to reproduce or a small repository showing the problem:
I am using TypeORM with NestJS. I have a subscriber implementing the
EntitySubscriberInterface
, specifically theafterInsert
. When inserting multiple values at once usingrepository.insert(values)
, theafterInsert
is called as many times as the values, but the attached entity is always the first of them. I have not found any other way to retrieve the entities inserted.The text was updated successfully, but these errors were encountered: