diff --git a/docs/content/docs/(documentation)/usage/database.mdx b/docs/content/docs/(documentation)/usage/database.mdx index b5db41c..bb57adc 100644 --- a/docs/content/docs/(documentation)/usage/database.mdx +++ b/docs/content/docs/(documentation)/usage/database.mdx @@ -106,6 +106,23 @@ export default { } satisfies BkndConfig; ``` +### Node.js SQLite + +To use the Node.js SQLite adapter directly, use the `nodeSqlite` function as value for the `connection` property. This lets you customize the database connection, such as enabling WAL mode. + +```typescript title="bknd.config.ts" +import { nodeSqlite, type NodeBkndConfig } from "bknd/adapter/node"; + +export default { + connection: nodeSqlite({ + url: "file:", + onCreateConnection: (db) => { + db.exec("PRAGMA journal_mode = WAL;"); + }, + }), +} satisfies NodeBkndConfig; +``` + ### Bun SQLite You can explicitly use the Bun SQLite adapter by passing the `bunSqlite` function to the `connection` property. This allows further configuration of the database, e.g. enabling WAL mode. @@ -123,23 +140,6 @@ export default { } satisfies BunBkndConfig; ``` -### Node.js SQLite - -To use the Node.js SQLite adapter directly, set the `connection` property to the result of the `nodeSqlite` function. This lets you customize the database connection, such as enabling WAL mode. - -```typescript title="bknd.config.ts" -import { nodeSqlite, type NodeBkndConfig } from "bknd/adapter/node"; - -export default { - connection: nodeSqlite({ - url: "file:", - onCreateConnection: (db) => { - db.exec("PRAGMA journal_mode = WAL;"); - }, - }), -} satisfies NodeBkndConfig; -``` - ### LibSQL Turso offers a SQLite-fork called LibSQL that runs a server around your SQLite database. The edge-version of the adapter is included in the bundle (remote only):