Skip to content

Commit 12fc229

Browse files
Oxyjunhyperlint-ai[bot]
authored andcommitted
[Hyperdrive] Fixing create Wrangler command (#16919)
* Fixing incorrect Hyperdrive command in Wrangler command list. * Making Hyperdrive and KV commands a partical render. * Update src/content/partials/workers/wrangler-commands/hyperdrive.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 4ebeca0 commit 12fc229

File tree

3 files changed

+115
-107
lines changed

3 files changed

+115
-107
lines changed

src/content/docs/workers/wrangler/commands.mdx

Lines changed: 1 addition & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -480,103 +480,7 @@ wrangler d1 migrations apply <DATABASE_NAME> [OPTIONS]
480480

481481
Manage [Hyperdrive](/hyperdrive/) database configurations.
482482

483-
### `create`
484-
485-
Create a new Hyperdrive configuration.
486-
487-
```txt
488-
wrangler hyperdrive create <ID> [OPTIONS]
489-
```
490-
491-
- `ID` string required
492-
- The ID of the Hyperdrive configuration to create.
493-
- `--connection-string` string optional
494-
- The database connection string in the form `postgres://user:password@hostname:port/database`.
495-
- `--host` string optional
496-
- The hostname or IP address Hyperdrive should connect to.
497-
- `--port` number optional
498-
- The database port to connect to.
499-
- `--scheme` string optional
500-
- The scheme used to connect to the origin database - e.g. postgresql or postgres.
501-
- `--database` string optional
502-
- The database (name) to connect to. For example, Postgres or defaultdb.
503-
- `--user` string optional
504-
- The username used to authenticate to the database.
505-
- `--password` string optional
506-
- The password used to authenticate to the database.
507-
- `--access-client-id` string optional
508-
- The Client ID of the Access token to use when connecting to the origin database, must be set with a Client Access Secret. Mutually exclusive with `port`.
509-
- `--access-client-secret` string optional
510-
- The Client Secret of the Access token to use when connecting to the origin database, must be set with a Client Access ID. Mutually exclusive with `port`.
511-
- `--caching-disabled` boolean optional
512-
- Disables the caching of SQL responses.
513-
- `--max-age` number optional
514-
- Specifies max duration for which items should persist in the cache, cannot be set when caching is disabled.
515-
- `--swr` number optional
516-
- Stale While Revalidate - Indicates the number of seconds cache may serve the response after it becomes stale, cannot be set when caching is disabled.
517-
518-
### `update`
519-
520-
Update an existing Hyperdrive configuration.
521-
522-
```txt
523-
wrangler hyperdrive update <ID> [OPTIONS]
524-
```
525-
526-
- `ID` string required
527-
- The ID of the Hyperdrive configuration to update.
528-
- `--name` string optional
529-
- The new name of the Hyperdrive configuration.
530-
- `--origin-host` string optional
531-
- The new database hostname or IP address Hyperdrive should connect to.
532-
- `--origin-port` string optional
533-
- The new database port to connect to.
534-
- `--database` string optional
535-
- The new database (name) to connect to. For example, Postgres or defaultdb.
536-
- `--origin-user` string optional
537-
- The new username used to authenticate to the database.
538-
- `--origin-password` string optional
539-
- The new password used to authenticate to the database.
540-
- `--access-client-id` string optional
541-
- The Client ID of the Access token to use when connecting to the origin database, must be set with a Client Access Secret. Mutually exclusive with `origin-port`.
542-
- `--access-client-secret` string optional
543-
- The Client Secret of the Access token to use when connecting to the origin database, must be set with a Client Access ID. Mutually exclusive with `origin-port`.
544-
- `--caching-disabled` boolean optional
545-
- Disables the caching of SQL responses.
546-
- `--max-age` number optional
547-
- Specifies max duration for which items should persist in the cache, cannot be set when caching is disabled.
548-
- `--swr` number optional
549-
- Stale While Revalidate - Indicates the number of seconds cache may serve the response after it becomes stale, cannot be set when caching is disabled.
550-
551-
### `list`
552-
553-
List all Hyperdrive configurations.
554-
555-
```txt
556-
wrangler hyperdrive list
557-
```
558-
559-
### `delete`
560-
561-
Delete an existing Hyperdrive configuration.
562-
563-
```txt
564-
wrangler hyperdrive delete <ID>
565-
```
566-
567-
- `ID` string required
568-
- The name of the Hyperdrive configuration to delete.
569-
570-
### `get`
571-
572-
Get an existing Hyperdrive configuration.
573-
574-
```txt
575-
wrangler hyperdrive get <ID>
576-
```
577-
578-
- `ID` string required
579-
- The name of the Hyperdrive configuration to get.
483+
<Render file="wrangler-commands/hyperdrive" product="workers" />
580484

581485
---
582486

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
{}
3+
---
4+
5+
import { AnchorHeading } from "~/components";
6+
7+
<AnchorHeading title="`create`" slug="hyperdrive-create" depth={3} />
8+
9+
Create a new Hyperdrive configuration.
10+
11+
```txt
12+
wrangler hyperdrive create <CONFIG_NAME> [OPTIONS]
13+
```
14+
15+
- `CONFIG_NAME` string required
16+
- The name of the Hyperdrive configuration to create.
17+
- `--connection-string` string optional
18+
- The database connection string in the form `postgres://user:password@hostname:port/database`.
19+
- `--host` string optional
20+
- The hostname or IP address Hyperdrive should connect to.
21+
- `--port` number optional
22+
- The database port to connect to.
23+
- `--scheme` string optional
24+
- The scheme used to connect to the origin database, for example, postgresql or postgres.
25+
- `--database` string optional
26+
- The database (name) to connect to. For example, Postgres or defaultdb.
27+
- `--user` string optional
28+
- The username used to authenticate to the database.
29+
- `--password` string optional
30+
- The password used to authenticate to the database.
31+
- `--access-client-id` string optional
32+
- The Client ID of the Access token to use when connecting to the origin database, must be set with a Client Access Secret. Mutually exclusive with `port`.
33+
- `--access-client-secret` string optional
34+
- The Client Secret of the Access token to use when connecting to the origin database, must be set with a Client Access ID. Mutually exclusive with `port`.
35+
- `--caching-disabled` boolean optional
36+
- Disables the caching of SQL responses.
37+
- `--max-age` number optional
38+
- Specifies max duration for which items should persist in the cache, cannot be set when caching is disabled.
39+
- `--swr` number optional
40+
- Stale While Revalidate - Indicates the number of seconds cache may serve the response after it becomes stale, cannot be set when caching is disabled.
41+
42+
<AnchorHeading title="`update`" slug="hyperdrive-update" depth={3} />
43+
44+
Update an existing Hyperdrive configuration.
45+
46+
```txt
47+
wrangler hyperdrive update <ID> [OPTIONS]
48+
```
49+
50+
- `ID` string required
51+
- The ID of the Hyperdrive configuration to update.
52+
- `--name` string optional
53+
- The new name of the Hyperdrive configuration.
54+
- `--origin-host` string optional
55+
- The new database hostname or IP address Hyperdrive should connect to.
56+
- `--origin-port` string optional
57+
- The new database port to connect to.
58+
- `--database` string optional
59+
- The new database (name) to connect to. For example, Postgres or defaultdb.
60+
- `--origin-user` string optional
61+
- The new username used to authenticate to the database.
62+
- `--origin-password` string optional
63+
- The new password used to authenticate to the database.
64+
- `--access-client-id` string optional
65+
- The Client ID of the Access token to use when connecting to the origin database, must be set with a Client Access Secret. Mutually exclusive with `origin-port`.
66+
- `--access-client-secret` string optional
67+
- The Client Secret of the Access token to use when connecting to the origin database, must be set with a Client Access ID. Mutually exclusive with `origin-port`.
68+
- `--caching-disabled` boolean optional
69+
- Disables the caching of SQL responses.
70+
- `--max-age` number optional
71+
- Specifies max duration for which items should persist in the cache, cannot be set when caching is disabled.
72+
- `--swr` number optional
73+
- Stale While Revalidate - Indicates the number of seconds cache may serve the response after it becomes stale, cannot be set when caching is disabled.
74+
75+
<AnchorHeading title="`list`" slug="hyperdrive-list" depth={3} />
76+
77+
List all Hyperdrive configurations.
78+
79+
```txt
80+
wrangler hyperdrive list
81+
```
82+
83+
<AnchorHeading title="`delete`" slug="hyperdrive-delete" depth={3} />
84+
85+
Delete an existing Hyperdrive configuration.
86+
87+
```txt
88+
wrangler hyperdrive delete <ID>
89+
```
90+
91+
- `ID` string required
92+
- The name of the Hyperdrive configuration to delete.
93+
94+
<AnchorHeading title="`get`" slug="hyperdrive-get" depth={3} />
95+
96+
Get an existing Hyperdrive configuration.
97+
98+
```txt
99+
wrangler hyperdrive get <ID>
100+
```
101+
102+
- `ID` string required
103+
- The name of the Hyperdrive configuration to get.

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
{}
3-
43
---
54

5+
import { AnchorHeading } from "~/components";
6+
67
## `kv namespace`
78

89
Manage Workers KV namespaces.
@@ -17,7 +18,7 @@ The `kv ...` commands allow you to manage your Workers KV resources in the Cloud
1718
Since version 3.60.0, Wrangler supports the `kv ...` syntax. If you are using versions below 3.60.0, the command follows the `kv:...` syntax. Learn more about the deprecation of the `kv:...` syntax in the [Wrangler commands](/kv/reference/kv-commands/#deprecations) for KV page.
1819
:::
1920

20-
### `create`
21+
<AnchorHeading title="`create`" slug="kv-namespace-create" depth={3} />
2122

2223
Create a new namespace.
2324

@@ -62,7 +63,7 @@ kv_namespaces = [
6263
]
6364
```
6465
65-
### `list`
66+
<AnchorHeading title="`list`" slug="kv-namespace-list" depth={3} />
6667
6768
List all KV namespaces associated with the current account ID.
6869
@@ -89,7 +90,7 @@ npx wrangler kv namespace list | jq "."
8990
]
9091
```
9192
92-
### `delete`
93+
<AnchorHeading title="`delete`" slug="kv-namespace-delete" depth={3} />
9394
9495
Delete a given namespace.
9596
@@ -151,7 +152,7 @@ The `kv ...` commands allow you to manage your Workers KV resources in the Cloud
151152
Since version 3.60.0, Wrangler supports the `kv ...` syntax. If you are using versions below 3.60.0, the command follows the `kv:...` syntax. Learn more about the deprecation of the `kv:...` syntax in the [Wrangler commands](/kv/reference/kv-commands/) for KV page.
152153
:::
153154
154-
### `put`
155+
<AnchorHeading title="`put`" slug="kv-key-put" depth={3} />
155156
156157
Write a single key-value pair to a particular namespace.
157158
@@ -230,7 +231,7 @@ npx wrangler kv key put --binding=MY_KV "my-key" --path=value.txt
230231
Writing the contents of value.txt to the key "my-key" on namespace f7b02e7fc70443149ac906dd81ec1791.
231232
```
232233
233-
### `list`
234+
<AnchorHeading title="`list`" slug="kv-key-list" depth={3} />
234235
235236
Output a list of all keys in a given namespace.
236237
@@ -276,7 +277,7 @@ npx wrangler kv key list --binding=MY_KV --prefix="public" | jq "."
276277
]
277278
```
278279
279-
### `get`
280+
<AnchorHeading title="`get`" slug="kv-key-get" depth={3} />
280281
281282
Read a single value by key from the given namespace.
282283
@@ -316,7 +317,7 @@ npx wrangler kv key get --binding=MY_KV "my-key"
316317
value
317318
```
318319
319-
### `delete`
320+
<AnchorHeading title="`delete`" slug="kv-key-delete" depth={3} />
320321
321322
Remove a single key value pair from the given namespace.
322323
@@ -368,7 +369,7 @@ The `kv ...` commands allow you to manage your Workers KV resources in the Cloud
368369
Since version 3.60.0, Wrangler supports the `kv ...` syntax. If you are using versions below 3.60.0, the command follows the `kv:...` syntax. Learn more about the deprecation of the `kv:...` syntax in the [Wrangler commands](/kv/reference/kv-commands/) for KV page.
369370
:::
370371
371-
### `put`
372+
<AnchorHeading title="`put`" slug="kv-bulk-put" depth={3} />
372373
373374
Write a JSON file containing an array of key-value pairs to the given namespace.
374375
@@ -450,7 +451,7 @@ npx wrangler kv bulk put --binding=MY_KV allthethingsupload.json
450451
Success!
451452
```
452453
453-
### `delete`
454+
<AnchorHeading title="`delete`" slug="kv-bulk-delete" depth={3} />
454455
455456
Delete all keys read from a JSON file within a given namespace.
456457

0 commit comments

Comments
 (0)