loopbackio / loopbackio/loopback-connector-postgresql

Option to use joins instead of multiple calls for relations.

Open
#491 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
JavaScript
Stars
118
Forks
184
Avg merge
1d 22h
Merged PRs (30d)
5

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, entry points, or acceptance criteria are named in the issue. Start by reviewing how relation includes and PostgreSQL queries are currently handled, then clarify the join syntax, model-level behavior, multi-datasource constraints, and tests required before implementation can be considered done.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs, postgresql
Domain
backend, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.