News for hackers. Stuff that matters.
Re:Sqlite3 WebAssembly by chrysoprace on Tuesday October 15, 2024 @06:23PM (#41853741)
I've been really interested in the local-first landscape lately but embedding SQLite seems really heavy-weight compared to using the browser's built-in storage APIs (in particular, IndexedDB) and it seems to be what most of the main open source libraries do. I'm interested to see a open-source solution (with sync) which provides an SQLite-like API but for the browser's native storage rather than trying to embed another executable in Web Assembly.
Re:Sqlite3 WebAssembly by jamesgpearce on Tuesday October 15, 2024 @07:09PM (#41854044)
Disclaimer: I'm the author. But you might be interested in TinyBase.
Re:Sqlite3 WebAssembly by chrysoprace on Tuesday October 15, 2024 @07:37PM (#41854213)
Thanks I'll give it a look! I guess I really was fishing for someone to make a recommendation and I see you have a lot of backend persistence options which I'm very excited about.

Another issue I have with a lot of the new local first products is that they tend to lock you into a particular database type on the backend, so this is refreshing.

Re:Sqlite3 WebAssembly by arunaugustine on Tuesday October 15, 2024 @11:30PM (#41855339)
TinyBase looks very promising! Is there a doc or reference you can guide me to, for using TinyBase with Preact.js instead of React?
Re:Sqlite3 WebAssembly by smallerfish on Wednesday October 16, 2024 @01:46PM (#41861733)
Nice work. Does it take time to hydrate tinybase from indexeddb, or do you mount it directly?

What are your thoughts about search over the store? Hydrate a separate lunr index?

And finally has anybody tried using your syncing over webrtc?

Re:Sqlite3 WebAssembly by gavmor on Tuesday October 15, 2024 @09:41PM (#41854825)
SQL is, arguably, more ergonomic than IndexedDB APIs, and may take up less RAM/CPU when, eg, using a `WHERE` clause rather than an `if() ` filter.
Re:Sqlite3 WebAssembly by chrysoprace on Wednesday October 16, 2024 @02:06AM (#41856054)
It's definitely more ergonomic, but the browser doesn't have an SQL API where as it does have IndexedDB. I'm hoping for tooling that makes IndexedDB more ergonomic while having a local-first syncing solution.

Dexie gives an ORM-like experience but their syncing solution is not FOSS.