[x] I've validated the bug against the latest version of DB packages
Describe the bug
When adding a bale, the item is correctly stored in memory, but after refreshing the page the data disappears.
@tanstack/browser-db-sqlite-persistence does not seem to persist the collection.
export const baleCollection = createCollection(
persistedCollectionOptions<Bale, string | number>({
...electricCollectionOptions({
id: "bales",
shapeOptions: {
url: getElectricUrl(),
params: { table: "bale" },
},
getKey: (i) => i.id,
async onInsert({ transaction, collection }) {
const newItem = transaction.mutations[0].modified;
const txid = await createBale(newItem);
await collection.utils.awaitTxId(txid);
},
}),
persistence,
schemaVersion: 1,
})
);
To Reproduce
Steps to reproduce:
- Add an item
- Refresh the page
- The previously added data is gone
Expected behavior
Data should persist across page reloads when using SQLite persistence.
Desktop (please complete the following information):
- OS: Windows 11
- Browser: Edge
- Version: 146.0.3856.97
Smartphone (please complete the following information):
N/A
Additional context
@tanstack/browser-db-sqlite-persistence: 0.1.6
@tanstack/electric-db-collection: 0.3.0
@tanstack/react-db: 0.1.80
[x] I've validated the bug against the latest version of DB packages
Describe the bug
When adding a bale, the item is correctly stored in memory, but after refreshing the page the data disappears.
@tanstack/browser-db-sqlite-persistencedoes not seem to persist the collection.To Reproduce
Steps to reproduce:
Expected behavior
Data should persist across page reloads when using SQLite persistence.
Desktop (please complete the following information):
Smartphone (please complete the following information):
N/A
Additional context
@tanstack/browser-db-sqlite-persistence:0.1.6@tanstack/electric-db-collection:0.3.0@tanstack/react-db:0.1.80