You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see in DB debugging inspector that if media_id is null on any on the related models, the orm result on triggering those useless DB queries:
I managed to fix this by conditionally lazy load models but it would be great to be the ORM enough smart to don't trigger those queries if the requested foreign key is null.
The issue seems not to be "nested lazy load" but more about what to do if the FK is null.
I recall that this is something we already discussed many times, but I don't remember where or when. I will have to do some search and get back to you.
Package version
20.6.0
Describe the bug
Hello everyone,
I really appreciate your work on Adonis, it is definitely one of the best and more productive frameworks I've ever work with.
While running some nested lazy loading as example:
I see in DB debugging inspector that if media_id is null on any on the related models, the orm result on triggering those useless DB queries:
I managed to fix this by conditionally lazy load models but it would be great to be the ORM enough smart to don't trigger those queries if the requested foreign key is null.
Temporary fix:
Any help would be welcomed as I'm also open to dig deeper on this if someone could guide me how to.
Thank you!
Reproduction repo
No response
The text was updated successfully, but these errors were encountered: