loopback-connector-postgresql
loopback-connector-postgresql copied to clipboard
Option to use joins instead of multiple calls for relations.
Suggestion
An option to use joins instead of multiple calls for relations would be useful for performance reasons and would also not effect multi datasources setups by default.
Use Cases
We are using a lot of DB calls with nested relations and each of those relations are fetched using extra DB calls which could be avoided. I understand the reasoning behind not using joins but I believe there should at least be an option to include relations through joins when required.
Examples
The syntax could be something like this -
"include": [ { "relation": "child", "join": "true" } ],
or this could be defined at the model level in the relation decorator.
Acceptance criteria
TBD - will be filled by the team.
Is it true that relation queries don't use joins?
Is this a loopback issue or a postgres connector issue?