mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
docs: swap Bun and Node.js SQLite sections
This commit is contained in:
@@ -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:<path/to/your/database.db>",
|
||||
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:<path/to/your/database.db>",
|
||||
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):
|
||||
|
||||
Reference in New Issue
Block a user