Refactoring work to support multi-tenancy and multiple storage, database backends (#598)
* Backend infrastructure * New backend configuration work * Factor out KV prefixing * Don't put assets in the manifest cache * Removed fancy authentication stuff * Documentation updates
This commit is contained in:
@@ -2,11 +2,11 @@ import "https://esm.sh/fake-indexeddb@4.0.2/auto";
|
||||
import { IndexedDBKvPrimitives } from "./indexeddb_kv_primitives.ts";
|
||||
import { DataStore } from "./datastore.ts";
|
||||
import { DenoKvPrimitives } from "./deno_kv_primitives.ts";
|
||||
import { KvPrimitives } from "./kv_primitives.ts";
|
||||
import { KvPrimitives, PrefixedKvPrimitives } from "./kv_primitives.ts";
|
||||
import { assertEquals } from "https://deno.land/std@0.165.0/testing/asserts.ts";
|
||||
|
||||
async function test(db: KvPrimitives) {
|
||||
const datastore = new DataStore(db, ["ds"], {
|
||||
const datastore = new DataStore(new PrefixedKvPrimitives(db, ["ds"]), {
|
||||
count: (arr: any[]) => arr.length,
|
||||
});
|
||||
await datastore.set(["user", "peter"], { name: "Peter" });
|
||||
|
||||
Reference in New Issue
Block a user