Closed attouab closed 3 weeks ago
How are you opening the database? The default setup here prints the chosen storage implementation, can you check which one is chosen?
Thanks @simolus3 , it saysit is using WasmStorageImplementation.inMemory, it doesnt report any missing features
it turned out I was missing the drift_worker.js file, and didnt get any error message to warn me about it, now its using WasmStorageImplementation.sharedIndexedDb
@simolus3 Should we add a error for this?
Yes I wanted to look into this - we're listening on errors already so we should have a way to detect this properly.
I've changed the detection logic to report worker errors explicitly in 97e16fd9d0d527c72436e03a16dae63ccde2bdc2.
I'm not sure if we should actively throw in that scenario. We can probably still use a local IndexedDB database, and WasmDatabase.open
is explicitly a "we'll try the best we can do" approach that reports problems without throwing. That means that we can't scream at users when things like the worker are missing, but the docs already mention a possible check for the return value to possibly reject databases where persistence is not possible.
I am using drift with flutter web, when I test locally (both release and debug) the saved data is lost when refreshing or opening a new tab. I can see that data is being saved and read from the database, however, I am not sure where the sql lite db file is created and I am not sure whey it is not persisted across different sessions