Conversation
Users can completely bypass the TanStack DB mutation system and use their existing mutation logic by calling backend APIs directly and either waiting for sync or manually refetching collections.
- Clarify this is about not rewriting existing logic, not avoiding optimistic updates - Add Electric's awaitTxId as a sync option - Show collection-specific approaches (QueryCollection refetch vs Electric awaitTxId) - Provide examples for both patterns
|
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@tanstack/electric-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
Contributor
|
Size Change: 0 B Total Size: 77.6 kB ℹ️ View Unchanged
|
Contributor
|
Size Change: 0 B Total Size: 2.89 kB ℹ️ View Unchanged
|
Present bypassing the mutation system as one of several valid approaches rather than an aggressive callout. Fits more naturally as the first option under Mutation Approaches.
Present TanStack DB's mutation approaches first, with bypassing the mutation system as the final option for those who prefer their existing patterns.
Manual transactions is niche and covered in detail later in its own section. Keep Mutation Approaches focused on the main patterns.
thruflo
reviewed
Nov 3, 2025
thruflo
reviewed
Nov 3, 2025
Explain that awaiting refetch/sync lets you know when the server change is loaded in the collection, so you can render new data, hide loading indicators, navigate, etc.
Include showing success messages as a common reason to await sync completion, alongside rendering data, hiding loaders, and navigating.
Clarify that you write to the server like normal, then use your collection's mechanism to await the server write and know when to update UI.
thruflo
approved these changes
Nov 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Address feedback from user who thought they had to use DB's built-in mutations system.