typeorm-polymorphic
typeorm-polymorphic copied to clipboard
Creates N queries for hydrateMany
This package creates one query per item for hydrateMany, and that is very slow as it would do 50 separate queries for 50 items that you want to hydrate.
It should make one query for all entities and then just map the result to the entities you want to hydrate.
I think it should either do that OR execute 1 query per entity type.
@bashleigh , any thoughts on this? I'd potentially be interested in working on a PR if you were on board.
@jspizziri Yes please do! That would've been a much better solution! Can't remember why I did each programatically! There's also an issue surrounding the calling to the database on the child->parent side that you might be able to resolve at the same time. The conditions I made seem to always favour the wrong relationship