Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/content/docs/workers/testing/miniflare/storage/d1.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Specify D1 Databases to add to your environment as follows:

```js
const mf = new Miniflare({
d1Databases: {
DB: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
},
d1Databases:{
DB:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
});
```

Expand All @@ -24,7 +24,8 @@ bound to a Worker. You can do this with the `getD1Database` method:

```js
const db = await mf.getD1Database("DB");
const { results } = await db.prepare("<Query>");
const stmt = await db.prepare("<Query>");
const returnValue = await stmt.run();

console.log(await res.json(results));
return Response.json(returnValue.results);
```
Loading