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
This loads in all the data as i would expect and produces the following queries:
SELECT*FROM`players`WHERE`players`.`id`=1AND`players`.`deleted_at` IS NULL;
SELECT*FROM`inventory_items`WHERE`inventory_items`.`id`=1AND`inventory_items`.`deleted_at` IS NULL;
SELECT*FROM`inventory_items`WHERE`inventory_items`.`id`=2AND`inventory_items`.`deleted_at` IS NULL;
I am hopeing there is a way to tell gorm to group the two queries to inventory_items so it produces the following queries:
SELECT*FROM`players`WHERE`players`.`id`=1AND`players`.`deleted_at` IS NULL;
SELECT*FROM`inventory_items`WHERE`inventory_items`.`id`IN(1, 2) AND`inventory_items`.`deleted_at` IS NULL;
The document you expected this should be explained
Your Question
If this has already been answered i appologise, i couldn't find one in my search.
I am looking for a way to group preload queries to the same table. Take this model for example:
I can then load the player with its associations:
This loads in all the data as i would expect and produces the following queries:
I am hopeing there is a way to tell gorm to group the two queries to
inventory_items
so it produces the following queries:The document you expected this should be explained
If this is possible then i would have expected it in the Associations Documentation or possibly the Has One Documentation
Expected answer
My guess is that this is not possible out of the box but thought it was worth an ask to save myself some time
The text was updated successfully, but these errors were encountered: