Skip to content

Commit e2f26ba

Browse files
Oxyjunlambrospetroumarciocloudflare
authored
[D1] Creating proper API documentation (#17923)
* Adding placeholder for new API section. * Initializing await stmt API chapter. * Reordering the sidebar. Adding intro to stmt.methods. * Setting up Worker Bindings API chapters. * Settling on naming convention, fleshing out .db chapter. * Setting up the database API section. * Fleshing out API chapters. * Updating D1 API docs. * Adding in more information to be complete. * Apply suggestions from code review Co-authored-by: Lambros Petrou <[email protected]> * Update src/content/docs/d1/worker-api/query.mdx * Updating the Return Object chapter. Testing more APIs. * Fleshing out the API docs in more detail. * Fixing broken link. * Changing reference to mention Worker Binding APIs. * Small rename. * Small rename. * Updating the chapters * Modifying the structure to align with discussion. * Renaming extensions header for better clarity. * Adding changelog entry for including multiple queries in a single prepared statement. * Updating wording in Get started to match new folders. * Fixing broken link * Implementing feedback. * Removing references to multi-statement prepare(). * Fixing broken links * Grammar fixes and deleting redundant comment block. * Apply suggestions from code review Co-authored-by: marciocloudflare <[email protected]> * Minor rename of the chapter * Cleaning up the structure by method hierarchy. * Adding a note for those who are following the tutorial with an existing Worker. * Actioning PR feedback. * Turning all method names into links to the relevant header. --------- Co-authored-by: Lambros Petrou <[email protected]> Co-authored-by: marciocloudflare <[email protected]>
1 parent 4bf90c8 commit e2f26ba

File tree

18 files changed

+800
-24
lines changed

18 files changed

+800
-24
lines changed

public/_redirects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@
295295
/d1/configuration/remote-development/ /d1/build-with-d1/remote-development/ 301
296296
/d1/build-with-d1/import-data/ /d1/build-with-d1/import-export-data/ 301
297297
/d1/reference/database-commands/ /d1/reference/sql-statements/ 301
298+
/d1/reference/sql-statements/ /d1/sql-api/sql-statements/ 301
298299

299300
# data loss prevention (dlp)
300301
/cloudflare-one/policies/data-loss-prevention/integration-profiles/ /cloudflare-one/policies/data-loss-prevention/dlp-profiles/integration-profiles/ 301

src/content/docs/d1/build-with-d1/d1-client-api.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ D1 PRAGMA statements only apply to the current transaction.
449449

450450
:::
451451

452-
For the full list of PRAGMA statements supported by D1, see [SQL statements](/d1/reference/sql-statements).
452+
For the full list of PRAGMA statements supported by D1, see [SQL statements](/d1/sql-api/sql-statements).
453453

454454
## Errors
455455

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: 4
5+
order: 6
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,6 +3,6 @@ pcx_content_type: navigation
33
title: D1 REST API
44
external_link: /api/operations/cloudflare-d1-create-database
55
sidebar:
6-
order: 10
6+
order: 5
77

88
---

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: 8
5+
order: 10
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: 6
7+
order: 8
88
group:
99
hideIndex: true
1010
---

src/content/docs/d1/get-started.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ This guide instructs you through:
2424

2525
You can perform these tasks through the CLI or through the Cloudflare dashboard.
2626

27+
:::note
28+
If you already have an existing Worker and an existing D1 database, follow this tutorial from [3. Bind your Worker to your D1 database](/d1/get-started/#3-bind-your-worker-to-your-d1-database).
29+
:::
30+
2731
## Prerequisites
2832

2933
<Render file="prereqs" product="workers" />
@@ -531,5 +535,5 @@ In this tutorial, you have:
531535
If you have any feature requests or notice any bugs, share your feedback directly with the Cloudflare team by joining the [Cloudflare Developers community on Discord](https://discord.cloudflare.com).
532536

533537
- See supported [Wrangler commands for D1](/workers/wrangler/commands/#d1).
534-
- Learn how to use the [D1 client API](/d1/build-with-d1/d1-client-api/) within your Worker.
538+
- Learn how to use [D1 Worker Binding APIs](/d1/worker-api/) within your Worker, and test them from the [API playground](/d1/worker-api/#api-playground).
535539
- Explore [community projects built on D1](/d1/reference/community-projects/).

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

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

src/content/docs/d1/platform/index.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: Platform
44
sidebar:
5-
order: 8
5+
order: 10
66
group:
77
hideIndex: true
88
---

src/content/docs/d1/reference/index.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: Reference
44
sidebar:
5-
order: 9
5+
order: 11
66
group:
77
hideIndex: true
88
---

0 commit comments

Comments
 (0)