sea-orm icon indicating copy to clipboard operation
sea-orm copied to clipboard

feat: add method `find_both_related()`

Open ProbablyClem opened this issue 1 year ago • 4 comments

PR Info

New Features

  • [x] new selector SelectBoth in which the return type is Vec<(E::Model, F::Model)>
  • [x] a new method fn select_both<F>(mut self, _: F) -> SelectBoth<E, F> on Select
  • [x] new method fn find_both_related()<R>(self, r: R) -> SelectBoth<E, R>

ProbablyClem avatar May 08 '23 09:05 ProbablyClem

I'm not familiar with the internals of SeaORM, but this looks like a very direct and clean conversion of the implementation for select_also.

Wouldn't it make sense to also add a find_both_related method? Thank you for your contribution.

Pascualex avatar May 11 '23 17:05 Pascualex

I'm not familiar with the internals of SeaORM, but this looks like a very direct and clean conversion of the implementation for select_also.

Wouldn't it make sense to also add a find_both_related method? Thank you for your contribution.

Thanks @pascualex Yeah, I do like that name, as it matches the find_xxx_related as talked in the issue. Do you think I should rename the inner_join_and_select or create a new one @tyt2y3 ?

ProbablyClem avatar May 12 '23 14:05 ProbablyClem

I renamed it for now, as I think find_both_related is a better name. I can still go back to inner_join_and_select if wanted just let me know

ProbablyClem avatar May 18 '23 08:05 ProbablyClem

Shame this wasn't merged

Bolognafingers avatar Aug 09 '24 07:08 Bolognafingers