Skip to content

Commit c07415e

Browse files
committed
Initialising API docs for getBookmark
1 parent b2bccd1 commit c07415e

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/content/docs/d1/worker-api/d1-database.mdx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ return new Response(dump, {
247247

248248
Starts a D1 Session which activates read replication.
249249

250-
```js
250+
```ts
251251
const session = env.DB.withSession("<constraint> or bookmark");
252252
```
253253

@@ -263,3 +263,22 @@ const session = env.DB.withSession("<constraint> or bookmark");
263263

264264
#### Return values
265265

266+
- <code>D1DatabaseSession</code>: <Type text="Object"/>
267+
- An object which contains the methods [`prepare()`](/d1/worker-api/d1-database#prepare) and [`getBookmark`](/d1/worker-api/d1-database#getbookmark).
268+
269+
### `getBookmark`
270+
271+
Retrieves the `bookmark` from the D1 Session.
272+
273+
```ts
274+
const session = db.withSession("first-primary");
275+
return { bookmark } = session.getBookmark();
276+
```
277+
278+
#### Parameters
279+
280+
- None
281+
282+
#### Return values
283+
284+
-

0 commit comments

Comments
 (0)