Is there a way to do a full join with Typeorm?
My current query looks like this:
this.myRepository.createQueryBuilder('myEntity')
I need to fetch all myEntity
rows. Sometimes they are related to a myRelatedEntity
row, in which case the data of the latter must be fetched too. Sometimes they are not related to a myRelationEntity
, in which case I still need to fetch the myEntity
row.
Apparently there is no other way to do what I need than with a FULL JOIN. However it seems like FULL JOINs are not available in Typeorm.
Is there any way I can reach my goal?
In my case I used query for that.
this.myRepository.query(`
SELECT *
FROM myEntity
FULL JOIN otherEntity ON otherEntity.id = myEntity.fid
`);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With