orbitinghail / sqlsync

SQLSync is a collaborative offline-first wrapper around SQLite. It is designed to synchronize web application state between users, devices, and the edge.
https://sqlsync.dev
Apache License 2.0
2.17k stars 28 forks source link

native sqlite extension #46

Open carlsverre opened 5 months ago

carlsverre commented 5 months ago

Currently SQLSync wraps SQLite in order to carefully control how SQLite behaves and improve the user experience of using SQLSync. But this makes SQLSync harder to port to new SQLite environments.

This feature request is to build a version of SQLSync that can run entirely within SQLite as a native extension.

Things to figure out:

carlsverre commented 5 months ago

The initial goal is to just get a loadable extension that works with the native run-time loadable extension system. This will ideally make SQLSync work with the largest amount of targets.

Then, work can begin on making it easier for folks running in the browser to use SQLite extensions. Some projects/prior work that is relevant to this effort:

It would be very cool to look into dynamically loading extensions at runtime via Wasm dynlinking, and ideally working with https://github.com/nalgeon/sqlean to support a large library of extensions.

carlsverre commented 5 months ago

Research notes as of Jan 24 2024

sqlite-loadable-rs

Just do it manually?

Vlcn bindings

VFS stacking

SQLite batch write mode (atomic write mode)