We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I was trying to do the following:
type A struct { Foo string Bar int Bs []B `gorm:"many2many:a_b` } type B struct { Field string As A[] `gorm:"many2many:a_b` } ... db.Preload("As", func(db *gorm.DB) *gorm.DB { return db.Select("foo").Order("bar ASC") }).First(&B{})
But the query that is executed is
SELECT * FROM "as" .... ORDER BY bar ASC
Obviously custom preloading doesn't handle Select() when retrieving a many2many association.
Select()
many2many
Is it wanted?
The text was updated successfully, but these errors were encountered:
This should been fixed, thank you for your report.
Sorry, something went wrong.
i have same problem, is that fixed ?
@jinzhu Faced with same problem, Select() is not working properly for m2m associations. I am using m2m and 1toM connections at the same time
No branches or pull requests
Hi,
I was trying to do the following:
But the query that is executed is
Obviously custom preloading doesn't handle
Select()
when retrieving amany2many
association.Is it wanted?
The text was updated successfully, but these errors were encountered: