runebook · rune
runebook · rune
No capabilities requested.
manifest: sha256:187fdc8993ae597e4401447846891c01cb7d031f8e187ae3dbae2ad47338d229
rune add @rune/postgres@0.1.1rune add @rune/postgres
Provide a PostgreSQL connection URL whose database already exists. Store operations use parameterized queries. The adapter creates the table and expiration index.
import { connect } from "@rune/postgres";
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 postgresStore(pool).
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