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

    Function claimRows

    • Atomically CLAIM a SET of rows and RETURN them: UPDATE table SET set WHERE where RETURNING *. The claim-then-act variant of claimOnce — for a batch sweep (mark a waitlist notified / a cart-recovery emailed) where each row must be handled exactly once even if the sweep overlaps: a concurrent run's UPDATE claims a DISJOINT set, so the side-effect (email, notify) fires once per row. Returns the rows THIS call won; act only on those.

      Type Parameters

      • T = Record<string, unknown>

      Parameters

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

      Returns Promise<T[]>