Skip to content
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

Closed
wants to merge 1 commit into from
Closed

API DEMO: find_with_linked #1725

wants to merge 1 commit into from

Conversation

billy1624
Copy link
Member

@billy1624 billy1624 self-assigned this Jun 27, 2023
@billy1624 billy1624 linked an issue Jun 27, 2023 that may be closed by this pull request
Copy link
Contributor

@darkmmon darkmmon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asking for clarification.

Comment on lines +767 to +771
"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`",
Copy link
Contributor

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

Copy link
Member Author

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

Comment on lines +807 to +820
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()),
Copy link
Contributor

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

Copy link
Member Author

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,
Copy link
Contributor

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?

Copy link
Member Author

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)?

@billy1624
Copy link
Member Author

I will closed this PR. @darkmmon please file your PR :P

@billy1624 billy1624 closed this Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing method "find_with_linked"
2 participants