Replies: 1 comment
-
A problem I know you would run into is locking. All the example VFS classes that support multiple connections (e.g. from multiple browser tabs), including IDBBatchAtomicVFS, use WebLocks to implement locking. Safari added WebLocks support in 15.4, so if you want to go back further than that then you'll need to replace the locking implementation. If you don't need to support SQLite's locking mechanism - i.e. if there will never be multiple connections wanting to access the database simultaneously, or if there are but your application manages the arbitration before either one gets to call SQLite - then it's a trivial patch to just return SQLITE_OK from the VFS methods xLock/xUnlock (edit: actually the base class does this, so you could just delete the subclass methods). Otherwise you can look through the history of this FAQ item to see alternatives to WebLocks that I considered, but I'll warn you that everything before WebLocks is annoying and painful. I think I concluded that a service worker was the best alternative, which really says something. I don't think there are any other browser APIs required that need 15.4, but I can't guarantee that. It's also quite possible that I use some Javascript language features that might have arrived in Safari relatively recently - at least that could be handled by transpiling. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Because WebSQL is deprecated and actually being removed we're looking for a replacement. Currently I'm testing wa-sqlite with an indexeddb backend, primarily because we need to support iOS.
When testing, I found that it works fine on iOS until 15.4, anything lower it throws the following error:
This seems to come from some flags that aren't supported in the older wasm runtimes, found some tips here: emscripten-core/emscripten#15673 and emscripten-core/emscripten#17609
I'm wanting to recompile sqlite to be more compatible, but are there any implications that it could have down the line with the DBBatchAtmoicVFS?
Beta Was this translation helpful? Give feedback.
All reactions