runebook · rune
runebook · rune
No capabilities requested.
manifest: sha256:4a3d6769a11e527c020b08d99734d5affd0de3db7426258c8b366be59207e2a8
rune add @rune/redis@0.1.1rune add @rune/redis
Provide a redis: or rediss: URL. The adapter uses atomic Lua writes and Redis-native expiration. Configure persistence if the application must survive a Redis restart.
import { connect } from "@rune/redis";
import { document } from "@rune/storage";
const db = await connect(process.env.DATABASE_URL!);
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 redisStore(client).
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