summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/kv/01_db.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/kv/01_db.ts b/ext/kv/01_db.ts
index 38dcb4ae0..16099c225 100644
--- a/ext/kv/01_db.ts
+++ b/ext/kv/01_db.ts
@@ -211,6 +211,14 @@ class AtomicOperation {
return this;
}
+ sum(key: Deno.KvKey, n: bigint): this {
+ return this.mutate({
+ type: "sum",
+ key,
+ value: new KvU64(n),
+ });
+ }
+
mutate(...mutations: Deno.KvMutation[]): this {
for (const mutation of mutations) {
const key = mutation.key;