gorm

hasmany(またはmany2many)のアソシエーション先で検索

解決策を見つけることができなかったので愚痴メモしておきます。 文章のみの説明で具体的なコードが出せなくてすみません。 例えばUser has many CreditCardsのような関係で、userId=1がCreditCardId=[1,2,3]を持っている場合、 user.creditCards に CreditC…

WHERE句でmany2manyの関係にあるテーブルのカラムを使いたい

joinをゴリゴリ書くことになりそうです。 How to query a many2many relationship with a Where clause on the association? · Issue #3287 · go-gorm/gorm · GitHub How to query a many2many relationship with a Where clause on the association with go…