loopback-connector-postgresql icon indicating copy to clipboard operation
loopback-connector-postgresql copied to clipboard

Option to use joins instead of multiple calls for relations.

Open akshatdubeysf opened this issue 2 years ago • 1 comments

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.

akshatdubeysf avatar Nov 01 '21 14:11 akshatdubeysf

Is it true that relation queries don't use joins?

Is this a loopback issue or a postgres connector issue?

amitlissack avatar Jan 22 '24 15:01 amitlissack