runebook · rune
runebook · rune
No capabilities requested.
manifest: sha256:75a66e689e727a2fea3b6482617b8e6fdae5706627b0c9e95b3826a4a780184d
rune add @rune/sqlite@0.1.1rune add @rune/sqlite
Use a pathname, a file URL, or :memory: in tests. The adapter uses Node’s built-in SQLite module. Keep the database on local persistent storage. It enables WAL and retries a busy database for up to five seconds.
import { connect } from "@rune/sqlite";
import { document } from "@rune/storage";
const db = await connect("./server.sqlite");
const visits = document(db.store, "visits", () => ({ total: 0 }));
await visits.update((value) => ({ total: value.total + 1 }));
// Call await db.close() when the connection is no longer needed.
Wrap an existing driver instance with sqliteStore(database).
Use db.store with Web Auth, or as a general-purpose record store.
Pass { name: "shared" } to connect to make the existing connection
reusable by other Runes. Storage configuration