What does HackerNews think of cr-sqlite?
Convergent, Replicated SQLite. Multi-writer and CRDT support for SQLite
Runs/syncs to the browser too which is just lovely.
For extensions but in Rust however, it's much more difficult. Matt @tantaman has some success cross compiling his cr-sqlite [2] project to WASM, but it's quite complex.
SQLite extensions typical rely on dlopen() to load dynamic libraries as an extension. WASM doesn't really have that, so you either have to statically compile your extension in your WASM build (which is difficult for non-C languages bc SQLite is written in C), or hack around some barely-supported WASM features that emulate dlopen(). Though I'm not the best with WASM, so hopefully someone with more WASM experience chimes in to help! It's something I'm tracking in this issue for the `sqlite-loadble-rs` project [3]
[0] https://observablehq.com/@asg017/introducing-sqlite-lines#ce...
[1] https://observablehq.com/@asg017/introducing-sqlite-path#cel...
Better to embed a CRDT inside sqlite that can understand the semantics of sqlite's data, like cr-sqlite is doing:
https://github.com/vlcn-io/cr-sqlite
51 days ago: https://news.ycombinator.com/item?id=33606311
> Tables are modeled as GSets...
> Rows are currently modeled as LWW maps. I.e., each column in a row is a LWW Register.
Multi value registers are also planned - though I'm not sure how that'll be implemented.
(One also has the opportunity to see failing writes to the LWW register, so for my app I can (in theory) potentially surface those somewhere to the user as a resolvable conflict.)
But some people are working on adding CRDTs to sqlite: https://github.com/vlcn-io/cr-sqlite
It'd be really fun to see if this approach can be adapted to sqlite's b-tree. But it might not work as-is. The b-tree implementation I have is quite a bit different from most b-trees because I'm storing offsets rather than "keys", and because I'm storing compacted runs of items rather than individual rows.
I went into a lot more detail about what it might look like here: https://github.com/vlcn-io/cr-sqlite/issues/65#issuecomment-...