Add SelectFourMany with consolidate() for star topology (#3054)#3088
Merged
Conversation
…solidate feat: SelectFourMany with consolidate() for star topology
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Staging PR for #3054 (preserves @TonySchneider's authorship + merged status per our branch policy for external contributions).
@TonySchneider's feature (merged into this branch)
Adds
SelectFourMany<E, F, G, H, TOP>,SelectFour::consolidate(), andSelectFourMany<TopologyStar>::all()— mirroringSelectThreeMany— so a parent fetched with three has-many children in one query consolidates intoVec<(E::Model, Vec<F::Model>, Vec<G::Model>, Vec<H::Model>)>instead of flatOptiontuples. Reusesretain_unique_models/ModelKey; star topology only (chain/tee can follow). Purely additive.Staging work (this branch)
SelectThreeMany/tee patterns: consolidation logic is faithful (correct first-occurrence ordering, childless-parent handling, per-child dedup).SelectFouris only everTopologyStar(sole constructor isSelectThree::find_also), so the Star-onlyall()covers every reachable case;SelectFourManyis exported viapub use select::*.tests/select_four_many_tests.rs): builds a 4-way star (center -> a, b, c), runsfind_also_related ×2 → find_also → consolidate().all(), and checks the a×b×c cross product consolidates back to one tuple per parent. Usesorder_by_ascon each child for deterministic order (matches the existingSelectThreeconsolidate test). Verified on SQLite, PostgreSQL, and rusqlite (sync).sea-orm-sync(the PR only touchedsrc/).