@suluk/drizzle - v0.1.6
    Preparing search index...

    Function claimOnce

    • Atomically CLAIM a transition: UPDATE table SET set WHERE where, returning true iff this call changed a row. The where MUST include the FROM-state guard (e.g. and(eq(id, n), eq(status, "pending"))) so a re-delivery / concurrent caller finds the row already transitioned and changes nothing → returns false. The single point that makes a once-only side-effect (charge, refund, decrement, email) safe to run when, and only when, the claim wins.

      Parameters

      • db: ClaimDb
      • table: unknown
      • where: SQL
      • set: Record<string, unknown>

      Returns Promise<boolean>