You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a has-many relationship on a struct and while trying to select items from it I am receiving this error message *errors.errorString: bun: has-many relation=Items does not have base model=Mission with id=[%!q(*int=0xc0004032a0)] (check join conditions)
On the Items struct, if I change the pointers to be non-pointers this works. The problem now is that NewInsert does not have an OmitZero method so I have to do this hacky bit:
This issue has been automatically marked as stale because it has not had activity in the last 30 days. If there is no update within the next 7 days, this issue will be closed.
This is using latest Bun on Go 1.17.
I have a has-many relationship on a struct and while trying to select items from it I am receiving this error message *errors.errorString: bun: has-many relation=Items does not have base model=Mission with id=[%!q(*int=0xc0004032a0)] (check join conditions)
The Items struct is defined as:
and the Missions model being:
Items can exist without being assigned to a mission. The query I am trying to run is this:
On the Items struct, if I change the pointers to be non-pointers this works. The problem now is that
NewInsert
does not have anOmitZero
method so I have to do this hacky bit:Could we get functionality to both include an
OmitZero
method onNewInsert
and allow pointers onrel:belongs-to
forrel:has-many
relationships?The text was updated successfully, but these errors were encountered: