Skip to content

Conversation

samwillis
Copy link
Collaborator

@samwillis samwillis commented Jun 6, 2025

This removes keyBy by ensuring all streams a keyed throughout a query, using a composite key for joins and keying on a composite of the groupBy values for when thats used.

Joined keys are formed as [${mainInputKey},${joinedInputKey}] - so a key looks like: [123,234], or [123,[321,234]] for multiple joins. This is implemented in the compiled pipeline by tanstack db query compiler.

GroupBy uses a JSON front for the key with the key+values extracted for the groupBy - this is how the key works in the D2TS groupBy operator and is just exposed on the resulting pipeline.

Copy link

changeset-bot bot commented Jun 6, 2025

🦋 Changeset detected

Latest commit: e01f741

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@tanstack/react-db Patch
@tanstack/vue-db Patch
@tanstack/db Patch
@tanstack/db-example-react-todo Patch
@tanstack/db-collections Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@samwillis samwillis force-pushed the samwillis/key-all-streams branch from aacb0da to fee9bbc Compare June 8, 2025 14:38
Copy link

pkg-pr-new bot commented Jun 8, 2025

@tanstack/db-example-react-todo

npm i https://pkg.pr.new/@tanstack/db@144
npm i https://pkg.pr.new/@tanstack/db-collections@144
npm i https://pkg.pr.new/@tanstack/react-db@144
npm i https://pkg.pr.new/@tanstack/vue-db@144

commit: e01f741

@samwillis samwillis changed the title WIP key all streams key all streams and remove keyBy Jun 8, 2025
@samwillis samwillis requested a review from KyleAMathews June 8, 2025 16:02
@samwillis samwillis marked this pull request as ready for review June 8, 2025 16:03
Copy link
Collaborator

@KyleAMathews KyleAMathews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

great refactor!

I think you need to update the PR body again?

@samwillis samwillis merged commit ee5d026 into main Jun 9, 2025
4 checks passed
@samwillis samwillis deleted the samwillis/key-all-streams branch June 9, 2025 13:10
@github-actions github-actions bot mentioned this pull request Jun 9, 2025
cursor bot pushed a commit that referenced this pull request Jul 16, 2025
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.

2 participants