Unverified Commit 9153dacd authored by An Nyeong's avatar An Nyeong
Browse files

Update docs for SqliteKvStore

parent 3a92557e
Loading
Loading
Loading
Loading
+30 −1
Original line number Diff line number Diff line
@@ -43,6 +43,35 @@ const federation = createFederation<void>({
});
~~~~

### `SqliteKvStore`

`SqliteKvStore` is a simple key–value store implementation that uses SQLite as
the backend storage. It provides persistent storage with minimal configuration.
It's suitable for development and testing. It uses native sqlite modules,
`node:sqlite` for Node.js and Deno, `bun:sqlite` for Bun.

Best for
:   Development and testing.

Pros
:   Simple, persistent with minimal configuration.

Cons
:   Limited scalability, not suitable for high-traffic production.

~~~~ typescript
# Node.js and Deno. Use `'bun:sqlite'` on Bun instead.
import { DatbaseSync } from "node:sqlite";
import { createFederation } from "@fedify/fedify";
import { SqliteKvStore } from "@fedify/sqlite";

const db = new DatabaseSync(:memory:);
const federation = createFederation<void>({
  // ...
  kv: new SqliteKvStore(db),
});
~~~~

### `DenoKvStore` (Deno only)

`DenoKvStore` is a key–value store implementation for [Deno] runtime that uses