1
0
silverbullet/plugos/lib/kv_primitives.ts
2023-12-11 12:11:47 +01:00

14 lines
352 B
TypeScript

import { KV, KvKey } from "$sb/types.ts";
export type KvQueryOptions = {
prefix?: KvKey;
};
export interface KvPrimitives {
batchGet(keys: KvKey[]): Promise<(any | undefined)[]>;
batchSet(entries: KV[]): Promise<void>;
batchDelete(keys: KvKey[]): Promise<void>;
query(options: KvQueryOptions): AsyncIterableIterator<KV>;
close(): void;
}