Describe the feature
I would like to request a feature that allows GORM to support conditional many to many (m2m) preload joins. Specifically, the ability to preload many-to-many relationships based on additional conditions and join statements. This feature should enable more complex data retrieval scenarios, allowing for conditional logic and multiple joins within a preload context.
Motivation
when dealing with complex data models, there is a need to perform complex queries involving many to many relationships with additional conditions. Current limitations in GORM necessitate workarounds, such as using raw queries or processing results in Go. Implementing this feature would significantly enhance GORM's utility in applications with complex data models
Checkout Django-ORM or SQL Alchemy for similar feature.
Related Issues
Check this sample: https://stackoverflow.com/questions/78296654/gorm-preload-doesnt-follow-the-join-conditions