Open hasbai opened 2 years ago
Any update, please?
It would be better we are able to lazy load as the default.
This is very much necessary. Please take it seriously.
Eliminating redundant queries for fetching the main record is essential for optimizing performance and reducing resource overhead.
Any updates on this?
Your Question
Suppose I have two structs A and B, which are many to many related.
Now I have a slice of A
[]A
, how to lazy load A.Bs for each A in []A?The document you expected this should be explained
https://gorm.io/docs/preload.html
I know preload is intended to do this, but what I actually need is to lazy load the relations when needed, not at the beginning.
Expected answer
Is there a simply way to implement this feature? Thanks for your help.