I am trying to join across multiple tables (three plus a join table in the middle). I think feed is lazily evaluating the last mix. I am trying to add a condition that restricts the results of the first table in the join, but I'm only interested in the fields from the last table in the join.
So, let's say I have tables clubs, peopleand hobbies, and a join table people-to-hobbiesfor the last two. Each club can have many people, and each person can have many hobbies.
I try to get full information about all the hobbies of people belonging to a particular club, but I do not need the fields from the table club. The connection table means that korma will create two queries, one of which will receive all the people who are in a particular club, and the other to get a hobby for this person through the people-to-hobbiesjoin table .
My korma request looks something like this:
(select clubs
(with people
(with hobbies
(fields :hobby-name :id)
(where {:clubs.name "korma coders"}))))
The problem is that I did not specify which fields I want from clubsand people, and by default - *. How can I not include fields from these tables? Is this possible, or the fact that it is hobbieslazily loaded means that korma should return some results in the first request (which gets me a filtered list of people), so when I come to interrogate him later for a hobby, it has identifiers, necessary to fulfill the second request?
Conan source
share