Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for left join in Get Query #31

Closed
janakact opened this issue Feb 15, 2019 · 4 comments
Closed

Support for left join in Get Query #31

janakact opened this issue Feb 15, 2019 · 4 comments

Comments

@janakact
Copy link

janakact commented Feb 15, 2019

If a particular optional relation is not present for the entity, the entry is not included in the join result.

private getJoinType(relationType: string): string {

@icewind
Copy link

icewind commented Mar 28, 2019

It would be very nice to have an ability to define join type. Since if we have(and we have :)) nullable relation then entire entry will be missing from result set. We can just override getOne in service but out of the box feature would be more convenient. Thank you.

@michaelyali
Copy link
Member

Yeah. Actually, I'm always forgetting about that issue :( Sorry

@Bnaya
Copy link

Bnaya commented Apr 8, 2019

As a workaround
I'm thinking about overriding getJoinType and return left join for one to one.
getJoinType is private, but // @ts-ignore should do the trick

Anyhow, making it configurable would be great.

@Bnaya
Copy link

Bnaya commented Apr 8, 2019

// @ts-ignore
CompetitiveSetsService.prototype.getJoinType = function getJoinType(relationType: string) {
  switch (relationType) {
    case "many-to-one":
      return "innerJoin";

    default:
      return "leftJoin";
  }
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants