-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Add more query join types (left, right, outer join) #13633
Copy link
Copy link
Open
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!S-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-ContentiousThere are nontrivial implications that should be thought throughThere are nontrivial implications that should be thought through
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!S-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-ContentiousThere are nontrivial implications that should be thought throughThere are nontrivial implications that should be thought through
What problem does this solve or what need does it fill?
The query join added in #11535 is useful, but only covers one of four common types of queries.
As discussed in #1658, these are:
The join added in the PR above is an "inner join", which is useful and straightforward to implement.
However, this isn't always the desired behavior.
We should learn from the extensive history of database and implement this foundational functionality.
What solution would you like?
Add the other join type methods, being clear that the base
joinis an inner join.Data that is missing should be filled with
None, and the fields that could be missing should be converted to theirOptionequivalents.What alternative(s) have you considered?
Maybe these join types aren't useful in practice in game dev and can just be omitted.
I had hoped that
Query::joincould take an extra parameter, theJoinTypeenum. However, I don't think that this is feasible, as the type returned varies based on the value based in. Perhaps a const generic would work, but that's blocked on rust-lang/rust#95174 for now.