GORM Playground Link
https://github.com/go-gorm/playground/pull/530
Description
Despite what the docs says, it is not possible to chose the selected columns when using join preloading.
Docs quote:
db.Joins("Account", DB.Select("id").Where("user_id = users.id AND name = ?", "someName").Model(&Account{}))
I would expect only the columns mentionned in Select() to be selected, but all the columns of the relation are selected instead. (Same thing with Omit(), which has no effect at all).
This is because Joins() adds all columns without checking the Omit or Select statement in query.go here.