Open vincekieft opened 1 year ago
When I remove the break from the generated code the relations are set but I can see how the foreign.R.SetVariation keeps getting overwritten to the last local. Besides that manually changing the generated code ofc is a no go
I am not sure when I'll be able to take a good look at this. In the meantime, if you can send in a PR to fix, that will be appreciated.
I cannot send in a PR, I dont know how to fix this. Dont know this codebase
I am also running into this problem. In my case I have a M-N-1 relationship chain and the "1"s aren't distributing over the "N"s properly. This seems to be because the code assumes that the set of objects in "N" is unique when doing the eager load, which doesn't hold when "N" is the set of objects in an M-N relationship.
Version: SQLBoiler v4.14.1 DB: mysql 8
Scenario: I have the following data that is looped through when eager loading:
This (by sqlboiler generated) code appends relations to non singular entity:
But the break on line 1245 causes the second (identical) item of slice to not have set relations. The resulting struct now doesn't have any SetVariationSets set.
What can I do to resolve this?
Another ticket that is still open and faced the exact same issue: https://github.com/volatiletech/sqlboiler/issues/457