Skip to content

Commit b0b5e60

Browse files
[D1] Fixing broken links for D1. (#19202)
* Fixing broken links for D1. * Update src/content/docs/d1/observability/billing.mdx Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com> --------- Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
1 parent 9d39b9f commit b0b5e60

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ You can then follow the steps to [import an existing database](#import-an-existi
107107

108108
## Export an existing D1 database
109109

110-
In addition to importing existing SQLite databases, you might want to export a D1 database for local development or testing. You can export a D1 database to a `.sql` file using [wrangler d1 export](/workers/wrangler/commands/#export) and then execute (import) with `d1 execute --file`.
110+
In addition to importing existing SQLite databases, you might want to export a D1 database for local development or testing. You can export a D1 database to a `.sql` file using [wrangler d1 export](/workers/wrangler/commands/#d1-export) and then execute (import) with `d1 execute --file`.
111111

112112
To export full D1 database schema and data:
113113

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sidebar:
88

99
D1 exposes analytics to track billing metrics (rows read, rows written, and total storage) across all databases in your account.
1010

11-
The metrics displayed in the [Cloudflare dashboard](https://dash.cloudflare.com/) are sourced from Cloudflares [GraphQL Analytics API](/analytics/graphql-api/). You can access the metrics [programmatically](#query-via-the-graphql-api) via GraphQL or HTTP client.
11+
The metrics displayed in the [Cloudflare dashboard](https://dash.cloudflare.com/) are sourced from Cloudflare's [GraphQL Analytics API](/analytics/graphql-api/). You can access the metrics [programmatically](/d1/observability/metrics-analytics/#query-via-the-graphql-api) via GraphQL or HTTP client.
1212

1313
## View metrics in the dashboard
1414

@@ -24,7 +24,7 @@ Note that billable usage history is stored for a maximum of 30 days.
2424

2525
## Billing Notifications
2626

27-
Usage-based billing notifications are available within the [Cloudflare dashboard](https://dash.cloudflare.com) for users looking to monitor their total account usage.
27+
Usage-based billing notifications are available within the [Cloudflare dashboard](https://dash.cloudflare.com) for users looking to monitor their total account usage.
2828

2929
Notifications on the following metrics are available:
3030
- Rows Read

src/content/docs/d1/platform/alpha-migration.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ This guide will instruct you to recreate alpha D1 databases on our production-re
1818
## Prerequisites
1919

2020
1. You have the [`wrangler` command-line tool](/workers/wrangler/install-and-update/) installed
21-
2. You are using `wrangler` version `3.33.0` or later (released March 2024) as earlier versions do not have the [`--remote` flag](/d1/platform/changelog/#change-in-wrangler-d1-execute-default) required as part of this guide
22-
3. An 'alpha' D1 database. All databases created before July 27th, 2023 ([release notes](/d1/platform/changelog/#new-default-storage-subsystem)) use the alpha storage backend, which is no longer supported and was not recommended for production.
21+
2. You are using `wrangler` version `3.33.0` or later (released March 2024) as earlier versions do not have the [`--remote` flag](/d1/platform/changelog/#2024-03-12) required as part of this guide
22+
3. An 'alpha' D1 database. All databases created before July 27th, 2023 ([release notes](/d1/platform/changelog/#2024-03-12)) use the alpha storage backend, which is no longer supported and was not recommended for production.
2323

2424
## 1. Verify that a database is alpha
2525

src/content/docs/d1/reference/migrations.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Database migrations are a way of versioning your database. Each migration is sto
1212

1313
Currently, the migrations system aims to be simple yet effective. With the current implementation, you can:
1414

15-
* [Create](/workers/wrangler/commands/#migrations-create) an empty migration file.
16-
* [List](/workers/wrangler/commands/#migrations-list) unapplied migrations.
17-
* [Apply](/workers/wrangler/commands/#migrations-apply) remaining migrations.
15+
* [Create](/workers/wrangler/commands/#d1-migrations-create) an empty migration file.
16+
* [List](/workers/wrangler/commands/#d1-migrations-list) unapplied migrations.
17+
* [Apply](/workers/wrangler/commands/#d1-migrations-apply) remaining migrations.
1818

1919
Every migration file in the `migrations` folder has a specified version number in the filename. Files are listed in sequential order. Every migration file is an SQL file where you can specify queries to be run.
2020

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ return Response.json(returnValue);
212212

213213
#### Guidance
214214

215-
- If an error occurs, an exception is thrown with the query and error messages, execution stops and further statements are not executed. Refer to [Errors](/d1/observability/#errors) to learn more.
215+
- If an error occurs, an exception is thrown with the query and error messages, execution stops and further statements are not executed. Refer to [Errors](/d1/observability/debug-d1/#errors) to learn more.
216216
- This method can have poorer performance (prepared statements can be reused in some cases) and, more importantly, is less safe.
217217
- Only use this method for maintenance and one-shot tasks (for example, migration jobs).
218218
- The input can be one or multiple queries separated by `\n`.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { DirectoryListing, Details, Steps } from "~/components";
1010
You can execute SQL queries on your D1 database from a Worker using the Worker Binding API. To do this, you can perform the following steps:
1111

1212
1. [Bind the D1 Database](/d1/worker-api/d1-database).
13-
2. [Prepare a statement](/d1/worker-api/d1-database/#dbprepare).
13+
2. [Prepare a statement](/d1/worker-api/d1-database/#prepare).
1414
3. [Run the prepared statement](/d1/worker-api/prepared-statements).
1515
4. Analyze the [return object](/d1/worker-api/return-object) (if necessary).
1616

@@ -20,7 +20,7 @@ Refer to the relevant sections for the API documentation.
2020

2121
D1 Worker Bindings API is fully-typed via the [`@cloudflare/workers-types`](/workers/languages/typescript/#typescript) package, and also supports [generic types](https://www.typescriptlang.org/docs/handbook/2/generics.html#generic-types) as part of its TypeScript API. A generic type allows you to provide an optional `type parameter` so that a function understands the type of the data it is handling.
2222

23-
When using the query statement methods [`D1PreparedStatement::run`](/d1/worker-api/prepared-statements/#run), [`D1PreparedStatement::raw`](/d1/worker-api/prepared-statements/#raw) and [`D1PreparedStatement::first`](/d1/worker-api/prepared-statements/#first), you can provide a type representing each database row. D1's API will [return the result object](#return-object) with the correct type.
23+
When using the query statement methods [`D1PreparedStatement::run`](/d1/worker-api/prepared-statements/#run), [`D1PreparedStatement::raw`](/d1/worker-api/prepared-statements/#raw) and [`D1PreparedStatement::first`](/d1/worker-api/prepared-statements/#first), you can provide a type representing each database row. D1's API will [return the result object](/d1/worker-api/return-object/#d1result) with the correct type.
2424

2525
For example, providing an `OrderRow` type as a type parameter to [`D1PreparedStatement::run`](/d1/worker-api/prepared-statements/#run) will return a typed `Array<OrderRow>` object instead of the default `Record<string, unknown>` type:
2626

src/content/docs/d1/worker-api/prepared-statements.mdx

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

88
import { Type, MetaInfo, Details } from "~/components";
99

10-
This chapter documents the various ways you can run and retrieve the results of a query after you have [prepared your statement](/d1/worker-api/d1-database/#dbprepare).
10+
This chapter documents the various ways you can run and retrieve the results of a query after you have [prepared your statement](/d1/worker-api/d1-database/#prepare).
1111

1212
## Methods
1313

src/content/partials/workers/wrangler-commands/d1.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ You must provide either `--command` or `--file` for this command to run successf
7878
- `-y, --yes` <Type text="boolean" /> <MetaInfo text="optional" />
7979
- Answer `yes` to any prompts.
8080
- `--local` <Type text="boolean" /> <MetaInfo text="(default: true) optional" />
81-
- Execute commands/files against a local database for use with [wrangler dev](#dev).
81+
- Execute commands/files against a local database for use with [wrangler dev](/workers/wrangler/commands/#dev).
8282
- `--remote` <Type text="boolean" /> <MetaInfo text="(default: false) optional" />
83-
- Execute commands/files against a remote D1 database for use with [wrangler dev --remote](#dev).
83+
- Execute commands/files against a remote D1 database for use with [wrangler dev --remote](/workers/wrangler/commands/#dev).
8484
- `--persist-to` <Type text="string" /> <MetaInfo text="optional" />
8585
- Specify directory to use for local persistence (for use in combination with `--local`).
8686
- `--json` <Type text="boolean" /> <MetaInfo text="optional" />
@@ -101,9 +101,9 @@ wrangler d1 export <DATABASE_NAME> [OPTIONS]
101101
- `DATABASE_NAME` <Type text="string" /> <MetaInfo text="required" />
102102
- The name of the D1 database to export.
103103
- `--local` <Type text="boolean" /> <MetaInfo text="(default: true) optional" />
104-
- Export from a local database for use with [wrangler dev](#dev).
104+
- Export from a local database for use with [wrangler dev](/workers/wrangler/commands/#dev).
105105
- `--remote` <Type text="boolean" /> <MetaInfo text="(default: false) optional" />
106-
- Export from a remote D1 database for use with [wrangler dev --remote](#dev).
106+
- Export from a remote D1 database for use with [wrangler dev --remote](/workers/wrangler/commands/#dev).
107107
- `--output` <Type text="string" /> <MetaInfo text="required" />
108108
- Path to the SQL file for your export.
109109
- `--table` <Type text="string" /> <MetaInfo text="optional" />

0 commit comments

Comments
 (0)