Skip to content

key all streams and remove keyBy - #144

Merged
samwillis merged 9 commits into
mainfrom
samwillis/key-all-streams
Jun 9, 2025
Merged

samwillis merged 9 commits into
mainfrom
samwillis/key-all-streams

Conversation

@samwillis

@samwillis samwillis commented Jun 6, 2025 •

Copy link
Copy Markdown
Collaborator

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.

@changeset-bot

changeset-bot Bot commented Jun 6, 2025 •

Copy link
Copy Markdown

🦋 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
@pkg-pr-new

pkg-pr-new Bot commented Jun 8, 2025 •

Copy link
Copy Markdown

@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
Comment thread packages/db/src/query/compiled-query.ts Resolved

@KyleAMathews KyleAMathews left a comment

Copy link
Copy Markdown
Collaborator

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