Fully offline support (through-the-database write pattern) with Tanstack DB? #3502
-
|
I'm currently using the through-the-database sync approach, as shown here: https://github.com/electric-sql/electric/tree/main/examples/write-patterns/patterns/4-through-the-db. I want my app to fully support offline mode, where changes can be made while offline and the changes will sync to the server when the connection is available, even if the app is closed and reopened in the meantime. I would like to move to using Tanstack DB if it simplifies my stack but it seems to me changes that are not yet synced are lost when the app is closed and reopened. Does Tanstack DB replace the need to use the through-the-database write pattern? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
Yes see https://github.com/TanStack/db/tree/main/packages/offline-transactions |
Beta Was this translation helpful? Give feedback.
-
|
That should do it. Thank you!!
…On Wed, Nov 26, 2025 at 5:57 PM Kyle Mathews ***@***.***> wrote:
Yes see
https://github.com/TanStack/db/tree/main/packages/offline-transactions
—
Reply to this email directly, view it on GitHub
<#3502 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA2PKYTLNR3JKJ5Q4ZNBRL36YV45AVCNFSM6AAAAACNGF7KWGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTKMBZGEYTQNA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Hey, on the same topic, i don't know if i'm missing something but i can't find anywhere on the documentation if the data is being persisted or at least a way to persist shapes to effectively use tanstack db + electric sql as an local first stack |
Beta Was this translation helpful? Give feedback.
Yes see https://github.com/TanStack/db/tree/main/packages/offline-transactions