Skip to content

Commit a72186c

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 93be5a5 commit a72186c

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
@@ -479,103 +479,7 @@ wrangler d1 migrations apply <DATABASE_NAME> [OPTIONS]
479479

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

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

580484
---
581485

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)