Skip to content

Commit 3643960

Browse files
committed
test
1 parent 0d7ef0a commit 3643960

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+525
-88
lines changed

public/_redirects

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -279,23 +279,30 @@
279279
# D1
280280
/d1/client-api/ /d1/worker-api/ 301
281281
/d1/build-with-d1/d1-client-api/ /d1/worker-api/ 301
282-
/d1/build-with-d1/import-data/ /d1/best-practices/import-export-data/ 301
283-
/d1/build-with-d1/ /d1/best-practices/ 301
284-
/d1/build-with-d1/import-export-data/ /d1/best-practices/import-export-data/ 301
285-
/d1/build-with-d1/use-indexes/ /d1/best-practices/use-indexes/ 301
286-
/d1/build-with-d1/remote-development/ /d1/best-practices/remote-development/ 301
287-
/d1/build-with-d1/local-development/ /d1/best-practices/local-development/ 301
282+
/d1/build-with-d1/import-data/ /d1/features/import-export-data/ 301
283+
/d1/build-with-d1/ /d1/features/ 301
284+
/d1/build-with-d1/import-export-data/ /d1/features/import-export-data/ 301
285+
/d1/build-with-d1/use-indexes/ /d1/features/use-indexes/ 301
286+
/d1/build-with-d1/remote-development/ /d1/features/remote-development/ 301
287+
/d1/build-with-d1/local-development/ /d1/features/local-development/ 301
288288
/d1/build-with-d1/foreign-keys/ /d1/sql-api/foreign-keys/ 301
289289
/d1/build-with-d1/query-json/ /d1/sql-api/query-json/ 301
290-
/d1/build-with-d1/use-d1-from-pages/ /d1/best-practices/use-d1-from-pages/ 301
290+
/d1/build-with-d1/use-d1-from-pages/ /d1/features/use-d1-from-pages/ 301
291+
/d1/best-practices/ /d1/features/ 301
292+
/d1/best-practices/import-export-data/ /d1/features/import-export-data/ 301
293+
/d1/best-practices/local-development/ /d1/features/local-development/ 301
294+
/d1/best-practices/query-d1/ /d1/features/query-d1/ 301
295+
/d1/best-practices/remote-development/ /d1/features/remote-development/ 301
296+
/d1/best-practices/use-d1-from-pages/ /d1/features/use-d1-from-pages/ 301
297+
/d1/best-practices/use-indexes/ /d1/features/use-indexes/ 301
291298
/d1/learning/using-d1-from-pages/ /pages/functions/bindings/#d1-databases 301
292299
/d1/learning/debug-d1/ /d1/observability/debug-d1/ 301
293-
/d1/learning/using-indexes/ /d1/best-practices/use-indexes/ 301
300+
/d1/learning/using-indexes/ /d1/features/use-indexes/ 301
294301
/d1/learning/querying-json/ /d1/sql-api/query-json/ 301
295-
/d1/learning/importing-data/ /d1/best-practices/import-export-data/ 301
302+
/d1/learning/importing-data/ /d1/features/import-export-data/ 301
296303
/d1/learning/generated-columns/ /d1/reference/generated-columns/ 301
297-
/d1/learning/local-development/ /d1/best-practices/local-development/ 301
298-
/d1/learning/remote-development/ /d1/best-practices/remote-development/ 301
304+
/d1/learning/local-development/ /d1/features/local-development/ 301
305+
/d1/learning/remote-development/ /d1/features/remote-development/ 301
299306
/d1/learning/data-location/ /d1/configuration/data-location/ 301
300307
/d1/migrations/ /d1/reference/migrations/ 301
301308
/d1/platform/wrangler-commands/ /workers/wrangler/commands/#d1 301
@@ -310,20 +317,20 @@
310317
/d1/reference/environments/ /d1/configuration/environments/ 301
311318
/d1/reference/metrics-analytics/ /d1/observability/metrics-analytics/ 301
312319
/d1/reference/wrangler-commands/ /d1/wrangler-commands/ 301
313-
/d1/how-to/ /d1/best-practices/ 301
314-
/d1/how-to/query-databases/ /d1/best-practices/query-d1/ 301
315-
/d1/how-to/using-indexes/ /d1/best-practices/use-indexes/ 301
320+
/d1/how-to/ /d1/features/ 301
321+
/d1/how-to/query-databases/ /d1/features/query-d1/ 301
322+
/d1/how-to/using-indexes/ /d1/features/use-indexes/ 301
316323
/d1/how-to/querying-json/ /d1/sql-api/query-json/ 301
317-
/d1/how-to/importing-data/ /d1/best-practices/import-export-data/ 301
324+
/d1/how-to/importing-data/ /d1/features/import-export-data/ 301
318325
/d1/how-to/generated-columns/ /d1/reference/generated-columns/ 301
319-
/d1/build-databases/ /d1/best-practices/ 301
320-
/d1/build-databases/query-databases/ /d1/best-practices/query-d1/ 301
321-
/d1/build-databases/use-indexes/ /d1/best-practices/use-indexes/ 301
322-
/d1/build-databases/import-data/ /d1/best-practices/import-export-data/ 301
326+
/d1/build-databases/ /d1/features/ 301
327+
/d1/build-databases/query-databases/ /d1/features/query-d1/ 301
328+
/d1/build-databases/use-indexes/ /d1/features/use-indexes/ 301
329+
/d1/build-databases/import-data/ /d1/features/import-export-data/ 301
323330
/d1/build-databases/client-api/ /d1/worker-api/ 301
324331
/d1/reference/query-json/ /d1/sql-api/query-json/ 301
325-
/d1/configuration/local-development/ /d1/best-practices/local-development/ 301
326-
/d1/configuration/remote-development/ /d1/best-practices/remote-development/ 301
332+
/d1/configuration/local-development/ /d1/features/local-development/ 301
333+
/d1/configuration/remote-development/ /d1/features/remote-development/ 301
327334
/d1/reference/database-commands/ /d1/reference/sql-statements/ 301
328335
/d1/reference/sql-statements/ /d1/sql-api/sql-statements/ 301
329336

505 KB
Loading

src/content/apps/index.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,3 +340,11 @@
340340
languages: [TypeScript]
341341
cloudflare: false
342342
updated: 2024-10-07
343+
- link: https://github.com/harshil1712/e-com-d1
344+
id: E-commerce Store
345+
description: An application to showcase D1 read replication in the context of an online store.
346+
tags: []
347+
products: [Workers, D1]
348+
languages: [TypeScript]
349+
cloudflare: true
350+
updated: 2025-02-27

src/content/docs/d1/configuration/data-location.mdx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ Learn how the location of data stored in D1 is determined, including where the l
99

1010
## Automatic (recommended)
1111

12-
By default, D1 will automatically create your database in a location close to where you issued the request to create a database. In most cases this allows D1 to choose the optimal location for your database on your behalf.
12+
By default, D1 will automatically create your primary database instance in a location close to where you issued the request to create a database. In most cases this allows D1 to choose the optimal location for your database on your behalf.
1313

1414
## Provide a location hint
1515

16-
Location hint is an optional parameter you can provide to indicate your desired geographical location for your database.
16+
Location hint is an optional parameter you can provide to indicate your desired geographical location for your primary database instance.
1717

18-
You may want to explicitly provide a location hint in cases where the majority of your writes to a specific database come from a different location than where you are creating the database from. location hints can be useful when:
18+
You may want to explicitly provide a location hint in cases where the majority of your writes to a specific database come from a different location than where you are creating the database from. Location hints can be useful when:
1919

2020
- Working in a distributed team.
2121
- Creating databases specific to users in specific locations.
@@ -33,9 +33,7 @@ Providing a location hint does not guarantee that D1 runs in your preferred loca
3333
### Use Wrangler
3434

3535
:::note
36-
3736
To install Wrangler, the command-line interface for D1 and Workers, refer to [Install and Update Wrangler](/workers/wrangler/install-and-update/).
38-
3937
:::
4038

4139
To provide a location hint when creating a new database, pass the `--location` flag with a valid location hint:
@@ -70,3 +68,11 @@ D1 supports the following location hints:
7068
:::caution
7169
D1 location hints are not currently supported for South America (`sam`), Africa (`afr`), and the Middle East (`me`). D1 databases do not run in these locations.
7270
:::
71+
72+
## Read replica locations
73+
74+
D1 read replication allows you to create and distribute read-only copies of the primary database instance around the world. This reduces the query latency for users located far away from the primary database instance.
75+
76+
When using D1 read replication through [Sessions API](/d1/features/read-replication/#how-d1-read-replication-works), D1 automatically creates a read replica in [every available region](/d1/configuration/data-location#available-location-hints), including the region where the primary database instance is located.
77+
78+
Refer to [D1 read replication](/d1/features/read-replication/) for more information.

src/content/docs/d1/configuration/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Configuration
33
pcx_content_type: navigation
44
sidebar:
5-
order: 8
5+
order: 9
66
group:
77
hideIndex: true
88
---

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ pcx_content_type: navigation
33
title: REST API
44
external_link: /api/resources/d1/subresources/database/methods/create/
55
sidebar:
6-
order: 6
6+
order: 7
77
---

src/content/docs/d1/demos.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pcx_content_type: navigation
33
title: Demos and architectures
44
sidebar:
5-
order: 12
5+
order: 13
66

77
---
88

src/content/docs/d1/examples/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ hideChildren: false
44
pcx_content_type: navigation
55
title: Examples
66
sidebar:
7-
order: 10
7+
order: 11
88
group:
99
hideIndex: true
1010
---

src/content/docs/d1/examples/query-d1-from-python-workers.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,4 @@ If you receive an error deploying:
126126

127127
- Refer to [Workers Python documentation](/workers/languages/python/) to learn more about how to use Python in Workers.
128128
- Review the [D1 Workers Binding API](/d1/worker-api/) and how to query D1 databases.
129-
- Learn [how to import data](/d1/best-practices/import-export-data/) to your D1 database.
129+
- Learn [how to import data](/d1/features/import-export-data/) to your D1 database.

src/content/docs/d1/best-practices/import-export-data.mdx renamed to src/content/docs/d1/features/import-export-data.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar:
77

88
D1 allows you to import existing SQLite tables and their data directly, enabling you to migrate existing data into D1 quickly and easily. This can be useful when migrating applications to use Workers and D1, or when you want to prototype a schema locally before importing it to your D1 database(s).
99

10-
D1 also allows you to export a database. This can be useful for [local development](/d1/best-practices/local-development/) or testing.
10+
D1 also allows you to export a database. This can be useful for [local development](/d1/features/local-development/) or testing.
1111

1212
## Import an existing database
1313

0 commit comments

Comments
 (0)