Skip to content

Row locks on SQLite / D1: refuse in the type, document the replacement #85

Open

Description

@artile

Signal

forUpdate / forShare exist for Postgres. SQLite and D1 have no row locks. We want:

  • forUpdate absent from the type of a D1 or SQLite query (capability-driven), not a run-time error.
  • Documented replacement patterns: a conditional update as a claim (UPDATE … WHERE status = 'pending' RETURNING), and single-writer Durable Objects.

Why (MyRemotely)

  • 29 FOR UPDATE sites today. Examples are tour slot booking, passcode allocation and RSVP races. Each one needs a D1 or DO form during the move.
  • A refusal in the type shows us every site that needs a redesign.

Part of #52: the CAFE-stack roadmap signal from MyRemotely. This shows the direction we want, and it is not a demand. We can send a PR if you accept the idea.

Activity

  1. Makisuo commented on Oct 25, 2026

    @Makisuo
    Contributor

    Partly addressed by #119: on SQLite and D1, forUpdate/forShare are refused at compile time (no row locks), before any SQL is sent. Still open: refusing them in the type (the type-level dialect work is in review in #106) and documenting the replacement patterns.

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