Skip to content

Drop postgres requirement for easier adoption #203

Description

@drew-royster

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions