Public
Versions
- Open: VersionChanges from v42 to v43+0-0⦚ 31 unchanged lines ⦚⦚ 31 unchanged lines ⦚
- Open: VersionChanges from v41 to v42+0-0⦚ 31 unchanged lines ⦚⦚ 31 unchanged lines ⦚
- Open: VersionChanges from v40 to v41+0-0⦚ 31 unchanged lines ⦚⦚ 31 unchanged lines ⦚
- Open: VersionChanges from v39 to v40+0-0⦚ 31 unchanged lines ⦚⦚ 31 unchanged lines ⦚
- Open: VersionChanges from v38 to v39+3-3import { sqlite } from "https://esm.town/v/std/sqlite?v=5";
import { keyvStore } from "https://esm.town/v/vladimyr/keyvhqSqlite";import Keyv from "npm:@keyvhq/core";const keyv = new Keyv({ store: keyvStore, namespace: "main" });const keyv2 = new Keyv({ store: keyvStore, namespace: "other" });await keyv.set("foo", "bar");⦚ 23 unchanged lines ⦚import { sqlite } from "https://esm.town/v/std/sqlite?v=5";import { sqliteStore } from "https://esm.town/v/vladimyr/keyvhqSqlite";import Keyv from "npm:@keyvhq/core";const keyv = new Keyv({ store: sqliteStore, namespace: "main" });const keyv2 = new Keyv({ store: sqliteStore, namespace: "other" });await keyv.set("foo", "bar");⦚ 23 unchanged lines ⦚ - Open: VersionChanges from v37 to v38+0-0⦚ 31 unchanged lines ⦚⦚ 31 unchanged lines ⦚
- Open: VersionChanges from v36 to v37+3-4import { sqlite } from "https://esm.town/v/std/sqlite?v=5";
import { createStore } from "https://esm.town/v/vladimyr/keyvhqSqlite";import Keyv from "npm:@keyvhq/core";const store = createStore();const keyv = new Keyv({ store, namespace: "main" });const keyv2 = new Keyv({ store, namespace: "other" });await keyv.set("foo", "bar");⦚ 23 unchanged lines ⦚import { sqlite } from "https://esm.town/v/std/sqlite?v=5";import { keyvStore } from "https://esm.town/v/vladimyr/keyvhqSqlite";import Keyv from "npm:@keyvhq/core";const keyv = new Keyv({ store: keyvStore, namespace: "main" });const keyv2 = new Keyv({ store: keyvStore, namespace: "other" });await keyv.set("foo", "bar");⦚ 23 unchanged lines ⦚ - Open: VersionChanges from v35 to v36+3-3import { sqlite } from "https://esm.town/v/std/sqlite?v=5";
import { KeyvSqlite } from "https://esm.town/v/vladimyr/keyvhqSqlite";import Keyv, { type Store } from "npm:@keyvhq/core";const store = new KeyvSqlite() as Store<unknown>;const keyv = new Keyv({ store, namespace: "main" });const keyv2 = new Keyv({ store, namespace: "other" });⦚ 25 unchanged lines ⦚import { sqlite } from "https://esm.town/v/std/sqlite?v=5";import { createStore } from "https://esm.town/v/vladimyr/keyvhqSqlite";import Keyv from "npm:@keyvhq/core";const store = createStore();const keyv = new Keyv({ store, namespace: "main" });const keyv2 = new Keyv({ store, namespace: "other" });⦚ 25 unchanged lines ⦚ - Open: Version+32-0import { sqlite } from "https://esm.town/v/std/sqlite?v=5";import { KeyvSqlite } from "https://esm.town/v/vladimyr/keyvhqSqlite";import Keyv, { type Store } from "npm:@keyvhq/core";const store = new KeyvSqlite() as Store<unknown>;const keyv = new Keyv({ store, namespace: "main" });const keyv2 = new Keyv({ store, namespace: "other" });await keyv.set("foo", "bar");console.log(await keyv.get("foo"));await keyv.set("baz", { num: 42, str: "hello" });console.log(await keyv.get("baz"));await keyv.set("temp", "test");await keyv.delete("temp");console.log();for await (const [key, val] of keyv.iterator()) {console.log("%s=%o", key, val);}await keyv2.set("keyv", "is cool");console.log();const result = await sqlite.execute("select * from keyv");console.log(result.rows);console.log();{await keyv.clear();const result = await sqlite.execute("select * from keyv");console.log(result.rows);}
Updated: April 1, 2024