Skip to main content
Module

x/kv_toolbox/batched_atomic.ts

Utilities for working with Deno KV 🦕🗝️
Go to Latest
import * as kvToolbox from "https://deno.land/x/kv_toolbox@0.13.0/batched_atomic.ts";

Provides the function batchedAtomic which is like Deno.Kv#atomic() but will work around the limitation 10 transactions per atomic operation.

Example

import { batchedAtomic } from "jsr:@kitsonk/kv-toolbox/batched_atomic";

const kv = await Deno.openKv();
await batchedAtomic(kv)
  .check({ key: ["hello"], versionstamp: null })
  .set(["hello"], "deno kv")
  .commit();
await kv.close();

Classes

The class that encapsulates the batched atomic operations, which works around the limitation of 10 transactions per operation.

Functions

Similar to Deno.Kv#atomic() but deals with the limit of transactions allowed per atomic operation.