Work on next-gen data store

This commit is contained in:
Zef Hemel
2023-09-03 21:15:17 +02:00
parent 541b347da4
commit 95d182e382
10 changed files with 511 additions and 2 deletions
+18
View File
@@ -0,0 +1,18 @@
export type KvKey = string[];
export type KvValue = any;
export type KV = {
key: KvKey;
value: KvValue;
};
export type KvQueryOptions = {
prefix?: KvKey;
};
export interface KvPrimitives {
batchGet(keys: KvKey[]): Promise<(KvValue | undefined)[]>;
batchSet(entries: KV[]): Promise<void>;
batchDelete(keys: KvKey[]): Promise<void>;
query(options: KvQueryOptions): AsyncIterableIterator<KV>;
}