That is not strictly accurate. There are places to...
# squarelibraries
j
That is not strictly accurate. There are places to store data in across refresh.
s
I understand that we could use
localstorage
.. but I feel that is more in the zone of
SharedPreferences
rather than saving larger amounts of data like an actual DB does. Are there any examples though where people have been able to connect to a DB using SQLDelight in JS?
j
You would use the origin-private file system not local storage
e
I think Jake means you can write a backend for sql.js that uses https://fs.spec.whatwg.org/#origin-private-file-system
I'm not sure if there is one that already exists, but there is https://jlongster.com/future-sql-web which is similar
j
I would check whatever we're doing in the repo. It was absurdsql for a while.
I think now it's regular sqlite compiled to wasm
h
If you want a persistent db in your browser you could either use absurd-sql, which is easy to setup (https://github.com/dellisd/sqldelight-js-worker/tree/absurd-sql) with a stable sqldelight version but deprecated or use sqlite wasm: https://github.com/dellisd/sqldelight-sqlite-wasm with a snapshot version of sqldelight