You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any plan to implement this? I've been playing around with libsql to potentially use in a production project due to the appeal of being able to more easily backup and sync with a remote version of the local db but libsql seems to have no persistence within the browser which limits it's capabilities in the browser and for browser extensions in particular. Compared to other language SDKs and other platforms, e.g. node and deno, there seems to be next to no real investment in browsers.
As outlined above, this doesn't seem to be working as you're using const db: Database = new sqlite3.oo1.DB(path, "c"); in here https://github.com/tursodatabase/libsql-client-ts/blob/main/packages/libsql-client-wasm/src/wasm.ts. Are there any plans to allow the user to explicitly declare to use opfs. Given that it works for something like https://github.com/DallasHoff/sqlocal, and is obviously baked into sqlite itself, I can imagine it's low lift to just switch it to sqlite3.oo1.OpfsDb. I can also see in your own demos that it does seem to be possible to get working in principle https://github.com/tursodatabase/libsql-wasm-experimental/blob/main/demo/worker.js but I imagine that the majority of the work for this would be in how the OpfsDb interacts with the rest of your client code and how that code behaves in a web worker, though I couldn't see anything that stuck out as particularly problematic.
Honestly, it'd just be really nice to have any real option for persistence. Having to load the db in memory just doesn't work well for a browser extension, particularly as the DB increases in size, after all the MV3 changes that forces your background script to be ephemeral. As a potential customer of Turso, I'd ideally like to let non-paying users just use a local DB and then let paying uses utilize all the additional features e.g. encryption, backup, sync, etc.
The current implementation runs in the main thread, making OPFS unavailable.
libsql-client-ts/packages/libsql-client-wasm/src/wasm.ts
Line 34 in fbf8f63
The text was updated successfully, but these errors were encountered: