Skip to content

Commit 4d697ce

Browse files
committed
Fixing curl json quote formatting.
1 parent bed72ca commit 4d697ce

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/content/docs/d1/best-practices/read-replication.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ Your application can use read replicas with D1 [Sessions API](/d1/worker-api/d1-
1414

1515
To checkout D1 read replication and Sessions API:
1616

17-
1. Deploy the following Worker code, which will prompt you to create a D1 database.
17+
1. Deploy the following Worker code, which will prompt you to create a D1 database.
1818

19-
[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/lambrospetrou/d1-starter-sessions-api)
19+
[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/lambrospetrou/d1-starter-sessions-api)
2020

2121
2. Enable read replication on the just created D1 database:
2222

2323
```curl
2424
curl -X PUT "https://api.cloudflare.com/client/v4/accounts/{account_id}/d1/database/{database_id}" \
2525
-H "Authorization: Bearer $TOKEN" \
2626
-H "Content-Type: application/json" \
27-
-d "{"read_replication": {"mode": "auto"}}"
27+
-d '{"read_replication": {"mode": "auto"}}'
2828
```
2929

3030
```ts collapse={1-6, 34-130}
@@ -200,7 +200,7 @@ Use an [API token](/fundamentals/api/get-started/create-token/) with `D1:Edit` [
200200
curl -X PUT "https://api.cloudflare.com/client/v4/accounts/{account_id}/d1/database/{database_id}" \
201201
-H "Authorization: Bearer $TOKEN" \
202202
-H "Content-Type: application/json" \
203-
-d "{"read_replication": {"mode": "auto"}}"
203+
-d '{"read_replication": {"mode": "auto"}}'
204204
```
205205
</TabItem><TabItem label="TypeScript">
206206
```ts
@@ -231,7 +231,7 @@ Use an [API token](/fundamentals/api/get-started/create-token/) with `D1:Edit` [
231231
curl -X PUT "https://api.cloudflare.com/client/v4/accounts/{account_id}/d1/database/{database_id}" \
232232
-H "Authorization: Bearer $TOKEN" \
233233
-H "Content-Type: application/json" \
234-
-d "{"read_replication": {"mode": "disabled"}}"
234+
-d '{"read_replication": {"mode": "disabled"}}'
235235
```
236236
</TabItem><TabItem label="TypeScript">
237237
```ts
@@ -252,12 +252,12 @@ await fetch ("/v4/accounts/{account_id}/d1/database/{database_id}", {
252252
</Tabs>
253253

254254
:::note
255-
Disabling read replication takes 24 hours for replicas to stop processing requests.
255+
Disabling read replication takes 24 hours for replicas to stop processing requests.
256256
:::
257257

258258
### Check if read replication is enabled
259259

260-
`GET` D1 database REST endpoint returns if read replication is enabled or disabled.
260+
`GET` D1 database REST endpoint returns if read replication is enabled or disabled.
261261
Use an [API token](/fundamentals/api/get-started/create-token/) with `D1:Read` [permission](/fundamentals/api/reference/permissions/#account-permissions).
262262

263263
<Tabs>
@@ -332,7 +332,7 @@ To create a Session from the latest database version, use `withSession("first-pr
332332
```ts
333333
const session = env.DB.withSession(`first-primary`) // synchronous
334334
// query executes on primary database
335-
const result = await session
335+
const result = await session
336336
.prepare(`SELECT * FROM Customers WHERE CompanyName = 'Bs Beverages'`)
337337
.run()
338338
```
@@ -483,7 +483,7 @@ export default {
483483

484484
### Check where D1 request was processed
485485

486-
To see how D1 requests are processed by the addition of read replicas, `served_by_region` and `served_by_primary` fields are returned in the `meta` object of [D1 Result](/d1/worker-api/return-object/#d1result).
486+
To see how D1 requests are processed by the addition of read replicas, `served_by_region` and `served_by_primary` fields are returned in the `meta` object of [D1 Result](/d1/worker-api/return-object/#d1result).
487487

488488
```ts
489489
const result = await env.DB.withSession()

0 commit comments

Comments
 (0)