-
-
Notifications
You must be signed in to change notification settings - Fork 524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API DEMO: find_with_linked
#1725
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asking for clarification.
"INNER JOIN `cakes_bakers` AS `r0` ON `r0`.`baker_id` = `baker`.`id`", | ||
"INNER JOIN `cake` AS `r1` ON `r1`.`id` = `r0`.`cake_id`", | ||
"INNER JOIN `lineitem` AS `r2` ON `r2`.`cake_id` = `r1`.`id`", | ||
"INNER JOIN `order` AS `r3` ON `r3`.`id` = `r2`.`order_id`", | ||
"INNER JOIN `customer` AS `r4` ON `r4`.`id` = `r3`.`customer_id`", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a inner join or a left join?
I found that other find_with/find_also functions use left join instead of inner join
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it should be LEFT JOIN
customer::Model { | ||
id: 1, | ||
name: "Kate".into(), | ||
notes: Some("Loves cheese cake".into()), | ||
}, | ||
customer::Model { | ||
id: 1, | ||
name: "Kate".into(), | ||
notes: Some("Loves cheese cake".into()), | ||
}, | ||
customer::Model { | ||
id: 2, | ||
name: "Kara".into(), | ||
notes: Some("Loves all cakes".into()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if the order of these matters or not, since they return in reverse order for my implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I have have ORDER BY
expression
ORDER BY `baker`.`id` ASC
), | ||
( | ||
baker::Model { | ||
id: 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this should be a 2 instead of 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems this is a follow up question of #1725 (comment)?
I will closed this PR. @darkmmon please file your PR :P |
PR Info