Hey when using SQLDelight with JS/Wasm + SQL.js, e...
# squarelibraries
b
Hey when using SQLDelight with JS/Wasm + SQL.js, everything is in-memory only by default, right? Is there a recipe to keep things persisted? I've seen mentions of "IndexedDb" and "OPFS" here and there, but nothing concrete. Is it a thing?
2
👀 1
e
We’re using it with opfs
👍 1
b
Ahh thanks! I'm not familiar with it (yet). Is there a KMP wrapper/lib you use or did you implement something yourself? And then you call SQL.js's
SQL.Database(data)
and
export()
and pass byte arrays around from/to OPFS, or something more involved?
e
We had to roll our own thing. Hoping to open source it at some point but still working out the kinks and trying to ship
b
👍 all right thanks 🙂
👍 1
For the posterity: here's a basic working example, based on the default worker with a few lines added to load/save the db file via OPFS.