runebook · rune
runebook · rune
No capabilities requested.
manifest: sha256:3246e6b86e02dde726045b1559cb9e7a0611f723dba40b15ab5e1190710f3fa1
rune add @rune/redis@0.1.0rune 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.