Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up`Identifiable` and `BelongsTo` don't compose like `JoinTo` does. #1427
Comments
sgrif
added this to the 1.2 milestone
Jan 15, 2018
This comment has been minimized.
|
There doesn't appear to be an obvious solution here unless we get some changes landed in the language. Attempting to implement |
sgrif
removed this from the 1.2 milestone
Feb 4, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sgrif commentedDec 20, 2017
•
edited
I needed to load some posts, the users who wrote them, the comments left on those posts, and the users who left those comments. Ignoring the "tables can only appear once" restriction (pretend that the second
usersisavatarsor something), I can write this:posts.inner_join(users).inner_join(comments.inner_join(avatars)), which would let me get back(Post, User, (Comment, Avatar). Since I can join from(posts, users)to(comments, avatars), I would expectBelongingToDslandGroupedByto behave similarly. We should make this code work (I've added additional intermediate vars and type annotations for clarity):