https://kotlinlang.org logo
#squarelibraries
Title
# squarelibraries
j

jw

02/12/2023, 3:52 AM
That is not strictly accurate. There are places to store data in across refresh.
s

Shubham Singh

02/12/2023, 3:54 AM
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

jw

02/12/2023, 3:55 AM
You would use the origin-private file system not local storage
e

ephemient

02/12/2023, 4:19 AM
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

jw

02/12/2023, 4:20 AM
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

hfhbd

02/12/2023, 8:58 AM
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
8 Views