feat: add method find_both_related()#1633
feat: add method find_both_related()#1633ProbablyClem wants to merge 11 commits intoSeaQL:masterfrom
find_both_related()#1633Conversation
inner_join_and_select
|
I'm not familiar with the internals of SeaORM, but this looks like a very direct and clean conversion of the implementation for Wouldn't it make sense to also add a |
Thanks @Pascualex |
|
I renamed it for now, as I think |
inner_join_and_selectfind_both_related()
|
Shame this wasn't merged |
|
@tyt2y3 @ProbablyClem - how do I help push this PR forward? The general consensus among some people I spoke to seems to be that this implementation (mandatory joins and selects) is the last blocker to adopting SeaORM in quite a few projects. What can I do to help here? |
|
Hey, |
|
Alternative solution - Does it make sense to create an extension trait (and a separate crate) to provide this functionality? Is there anything about this PR that uses private items? Once this gets upstreamed, our external crate can be depreciated. Until then perhaps this temporary workaround can be made? I imagine the maintainers are either busy or ping-bombed, so hopefully this can be a stop-gap solution for the interim |
|
LGTM. The only thing left is to rebase onto master. If you prefer, you can replace generics with impl Trait to simplify the code. |
|
Seeding some thoughts into your head here:
FYI - These are all breaking changes, so if there's any contention about the naming of these types, making these changes before the 2.0 release freezes would be the best time. |
|
I think we can keep the name |
|
Awesome! Thanks for the inputs! @ProbablyClem would you happen to have the time to rebase this PR with the naming change? Happy to lend a hand if required |
|
Honnestly I have very little time at the moment and I've not looked into this codebase for years so I would appreciate your help. |
|
No worries! Thanks for the work you've put in so far. Really appreciate it. To be honest, I've never "rebased someone else's PR" before. Do I get write access to your repo or do I fork it and put a new PR? My concern with the latter being whether you get attribution for your work |
|
I think you can either fork my branch and open your own PR, |
…ross the codebase
Renamed `SelectBoth` to `SelectTwoRequired`
|
I've opened #2997 that supersedes this PR. This can be closed |
|
@Huliiiiii if you can please approve workflow runs on my PR, I can make sure the tests pass |
|
Thanks. Approved the run |
|
Awesome! The build for #2997 passes. Can we have that merged please? This PR can be closed |
PR Info
find_also_related()with non null relation, or using inner join, should not return OptionNew Features
SelectBothin which the return type isVec<(E::Model, F::Model)>fn select_both<F>(mut self, _: F) -> SelectBoth<E, F>on Selectfn find_both_related()<R>(self, r: R) -> SelectBoth<E, R>