Skip to content

Conversation

@LuggaPugga
Copy link

@LuggaPugga LuggaPugga commented Dec 20, 2025

🎯 Changes

This PR adds a writeUpsert utility to the localstorage collection, inspired by the upsert utility in the query collection
Feel free to let me know if you'd like any changes

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm test.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

@changeset-bot
Copy link

changeset-bot bot commented Dec 20, 2025

🦋 Changeset detected

Latest commit: 9e5dc2f

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

This PR includes changesets to release 14 packages
Name Type
@tanstack/db Minor
@tanstack/angular-db Patch
@tanstack/electric-db-collection Patch
@tanstack/offline-transactions Patch
@tanstack/powersync-db-collection Patch
@tanstack/query-db-collection Patch
@tanstack/react-db Patch
@tanstack/rxdb-db-collection Patch
@tanstack/solid-db Patch
@tanstack/svelte-db Patch
@tanstack/trailbase-db-collection Patch
@tanstack/vue-db Patch
todos Patch
@tanstack/db-example-paced-mutations-demo 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
Copy link
Collaborator

Hey @LuggaPugga, could I ask what the motivation is for this api? I'm not 100% sure how this is different from just calling .write() on a local stage collection, both write to the local storage and update the synced state, but by slight different mechanisms.

@LuggaPugga
Copy link
Author

Hey @LuggaPugga, could I ask what the motivation is for this api? I'm not 100% sure how this is different from just calling .write() on a local stage collection, both write to the local storage and update the synced state, but by slight different mechanisms.

I have a JSON object and I want to update one of its values without needing to include the previous data in the .write()

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