Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

192
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda