Skip to content

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

Open
TonySchneider wants to merge 1 commit intoSeaQL:masterfrom
TonySchneider:feat/select-four-many-consolidate
Open

feat: SelectFourMany with consolidate() for star topology#3054
TonySchneider wants to merge 1 commit intoSeaQL:masterfrom
TonySchneider:feat/select-four-many-consolidate

Conversation

@TonySchneider
Copy link
Copy Markdown

@TonySchneider TonySchneider commented Apr 26, 2026

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
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.

1 participant