Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

198
Views
Problem in Typeorm EventSubscriber & Postgres AfterInsert

I have a big problem with EventSubscribers of typeorm & PostgreSQL.

I need to set Notification for a newly created Entity inside the AfterInsert event on TypeormEventSubscriber but, when I try to set the relations there is nothing inserted into the database to do that.

# Output of event.entity

Entity: {
  id: 34,
}

# It seems everything is ok and the record inserted but it's not.

Typeorm runs every query including the event hooks query inside a transaction as it seems, until every query is not done correctly, nothing is inserted into the database, which means I can not create relations in events even in AfterInserted because nothing is written into tables.

there is no other solution for this use case?
I can write the code after entity saved within my service but, not what I'm looking for.

thanks...

TYPEORM:POSTGRESQL Set relations on event hooks

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!