8000 Broadcast identifier for inserted related entities · Issue #9965 · typeorm/typeorm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Broadcast identifier for inserted related entities  #9965
Closed
@strongpauly

Description

@strongpauly

Feature Description

Given a cascading one-to-many relationship where post contains category: a subscriber listening to insert events for category will never receive any data about the category if it was inserted by cascade from saving a post. The subscriber will only ever know that there is a insert event but not which category is affected.

The Solution

The subject executor passes the subject identifier to the broadcaster for all insert events. The broadcaster uses the identifier as a fallback to set entityId for the events if the database entity is undefined.

Considered Alternatives

As explained in the related issue, the suggested solution would be a minimal approach that only broadcasts the entity's identifier instead of the complete entity. Another approach would be to load the related entities from the database. However, as described in the linked issue, this is not as feasible

Additional Context

Relates to #9912

Relevant Database Driver(s)

  • aurora-mysql
  • aurora-postgres
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • mysql
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • spanner
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

Yes, I have the time, but I don't know how to start. I would need guidance.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0