Awesome project! While it's in early stages I think this project is most likely to be used single player. With that said making a sqlite adapter I think would be worthwhile.
here's a rough plan from claude
Add a SQLite storage adapter for single-user local use. It seems to fit
the current design:
- One process already owns writes (the writer lease plus the global advisory
lock), which is SQLite's normal mode.
- The Postgres adapter uses Bun's
SQL, which also accepts sqlite:// URLs.
RETURNING, ON CONFLICT, JSON functions and BLOBs work there.
storageContract already runs against two adapters, so a third could be
proven against it.
The main gotcha: Bun's SQLite mode doesn't queue concurrent sql.begin()
calls, so the adapter would need to run transactions one at a time. With a
simple promise queue, 20 concurrent transactions all succeeded; without it,
19 failed.
Awesome project! While it's in early stages I think this project is most likely to be used single player. With that said making a sqlite adapter I think would be worthwhile.
here's a rough plan from claude
Add a SQLite storage adapter for single-user local use. It seems to fit
the current design:
lock), which is SQLite's normal mode.
SQL, which also acceptssqlite://URLs.RETURNING,ON CONFLICT, JSON functions and BLOBs work there.storageContractalready runs against two adapters, so a third could beproven against it.
The main gotcha: Bun's SQLite mode doesn't queue concurrent
sql.begin()calls, so the adapter would need to run transactions one at a time. With a
simple promise queue, 20 concurrent transactions all succeeded; without it,
19 failed.