Skip to content

feat: SelectFourMany with consolidate() for star topology#3054

Merged
tyt2y3 merged 1 commit into
SeaQL:staging/pr-3054-select-four-manyfrom
TonySchneider:feat/select-four-many-consolidate
Jun 17, 2026
Merged

feat: SelectFourMany with consolidate() for star topology#3054
tyt2y3 merged 1 commit into
SeaQL:staging/pr-3054-select-four-manyfrom
TonySchneider:feat/select-four-many-consolidate

Conversation

@TonySchneider

@TonySchneider TonySchneider commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

PR Info

  • Closes
  • Dependencies: none
  • Dependents: none

New Features

  • SelectFourMany<E, F, G, H, TOP> mirroring SelectThreeMany
  • SelectFour::consolidate() returning SelectFourMany
  • SelectFourMany<TopologyStar>::all() returning Vec<(E::Model, Vec<F::Model>, Vec<G::Model>, Vec<H::Model>)>
  • Internal consolidate_query_result_quad_star helper (mirrors consolidate_query_result_tee)

Bug Fixes

  • N/A

Breaking Changes

  • None - purely additive

Changes

SelectFour::all() returns flat tuples (E, Option<F>, Option<G>, Option<H>) and there's no consolidate() to roll has_many children up into Vecs the way SelectThreeMany does. Hit this fetching a parent entity along with three of its has_many children in one query - ended up batching a separate fetch for the fourth entity, which feels off given the rest of the codebase uses consolidate() consistently. This PR adds the equivalent for SelectFour, star topology only (E -> F, E -> G, E -> H); chain/tee variants can follow if needed. Reuses retain_unique_models and ModelKey so behavior matches the 3-way path. Unit tests cover single-row, sparse children, cross-product dedup, and multi-parent ordering.

@Huliiiiii Huliiiiii requested a review from tyt2y3 April 26, 2026 13:57
@nihohit

nihohit commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

@tyt2y3 can this be reviewed, please?

@tyt2y3 tyt2y3 changed the base branch from master to staging/pr-3054-select-four-many June 17, 2026 22:25
@tyt2y3 tyt2y3 merged commit 8b28db3 into SeaQL:staging/pr-3054-select-four-many Jun 17, 2026
39 checks passed
tyt2y3 added a commit that referenced this pull request Jun 18, 2026
Adds `SelectFourMany<E, F, G, H, TOP>`, `SelectFour::consolidate()`, and `SelectFourMany<TopologyStar>::all()` — mirroring `SelectThreeMany` — so a parent fetched with three has-many children in one query consolidates into `Vec<(E::Model, Vec<F::Model>, Vec<G::Model>, Vec<H::Model>)>` instead of flat `Option` tuples. Star topology only; purely additive.

Co-authored-by: TonySchneider <tony@sodot.dev>
tyt2y3 added a commit that referenced this pull request Jun 18, 2026
@github-actions

Copy link
Copy Markdown

🎉 Released In 2.0.0-rc.41 🎉

Huge thanks for the contribution!
This feature has now been released, so it's a great time to upgrade.
Show some love with a ⭐ on our repo, every star counts!

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.

3 participants