From f4dad38a82120ba126dee822d604b6d3baff3621 Mon Sep 17 00:00:00 2001 From: Jun Lee Date: Wed, 18 Sep 2024 14:59:19 +0100 Subject: [PATCH 1/3] Fixing incorrect Hyperdrive command in Wrangler command list. --- src/content/docs/workers/wrangler/commands.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/docs/workers/wrangler/commands.mdx b/src/content/docs/workers/wrangler/commands.mdx index ea96bd8798167c..81b20600a08bae 100644 --- a/src/content/docs/workers/wrangler/commands.mdx +++ b/src/content/docs/workers/wrangler/commands.mdx @@ -484,11 +484,11 @@ Manage [Hyperdrive](/hyperdrive/) database configurations. Create a new Hyperdrive configuration. ```txt -wrangler hyperdrive create [OPTIONS] +wrangler hyperdrive create [OPTIONS] ``` -- `ID` string required - - The ID of the Hyperdrive configuration to create. +- `CONFIG_NAME` string required + - The name of the Hyperdrive configuration to create. - `--connection-string` string optional - The database connection string in the form `postgres://user:password@hostname:port/database`. - `--host` string optional From 1ada3ad5bc2b302441513ca24b1dcdaeee4f8899 Mon Sep 17 00:00:00 2001 From: Jun Lee Date: Wed, 18 Sep 2024 15:32:35 +0100 Subject: [PATCH 2/3] Making Hyperdrive and KV commands a partical render. --- .../docs/workers/wrangler/commands.mdx | 98 +---------------- .../workers/wrangler-commands/hyperdrive.mdx | 103 ++++++++++++++++++ .../partials/workers/wrangler-commands/kv.mdx | 21 ++-- 3 files changed, 115 insertions(+), 107 deletions(-) create mode 100644 src/content/partials/workers/wrangler-commands/hyperdrive.mdx diff --git a/src/content/docs/workers/wrangler/commands.mdx b/src/content/docs/workers/wrangler/commands.mdx index 81b20600a08bae..3005957f2f8627 100644 --- a/src/content/docs/workers/wrangler/commands.mdx +++ b/src/content/docs/workers/wrangler/commands.mdx @@ -479,103 +479,7 @@ wrangler d1 migrations apply [OPTIONS] Manage [Hyperdrive](/hyperdrive/) database configurations. -### `create` - -Create a new Hyperdrive configuration. - -```txt -wrangler hyperdrive create [OPTIONS] -``` - -- `CONFIG_NAME` string required - - The name of the Hyperdrive configuration to create. -- `--connection-string` string optional - - The database connection string in the form `postgres://user:password@hostname:port/database`. -- `--host` string optional - - The hostname or IP address Hyperdrive should connect to. -- `--port` number optional - - The database port to connect to. -- `--scheme` string optional - - The scheme used to connect to the origin database - e.g. postgresql or postgres. -- `--database` string optional - - The database (name) to connect to. For example, Postgres or defaultdb. -- `--user` string optional - - The username used to authenticate to the database. -- `--password` string optional - - The password used to authenticate to the database. -- `--access-client-id` string optional - - 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`. -- `--access-client-secret` string optional - - 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`. -- `--caching-disabled` boolean optional - - Disables the caching of SQL responses. -- `--max-age` number optional - - Specifies max duration for which items should persist in the cache, cannot be set when caching is disabled. -- `--swr` number optional - - Stale While Revalidate - Indicates the number of seconds cache may serve the response after it becomes stale, cannot be set when caching is disabled. - -### `update` - -Update an existing Hyperdrive configuration. - -```txt -wrangler hyperdrive update [OPTIONS] -``` - -- `ID` string required - - The ID of the Hyperdrive configuration to update. -- `--name` string optional - - The new name of the Hyperdrive configuration. -- `--origin-host` string optional - - The new database hostname or IP address Hyperdrive should connect to. -- `--origin-port` string optional - - The new database port to connect to. -- `--database` string optional - - The new database (name) to connect to. For example, Postgres or defaultdb. -- `--origin-user` string optional - - The new username used to authenticate to the database. -- `--origin-password` string optional - - The new password used to authenticate to the database. -- `--access-client-id` string optional - - 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`. -- `--access-client-secret` string optional - - 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`. -- `--caching-disabled` boolean optional - - Disables the caching of SQL responses. -- `--max-age` number optional - - Specifies max duration for which items should persist in the cache, cannot be set when caching is disabled. -- `--swr` number optional - - Stale While Revalidate - Indicates the number of seconds cache may serve the response after it becomes stale, cannot be set when caching is disabled. - -### `list` - -List all Hyperdrive configurations. - -```txt -wrangler hyperdrive list -``` - -### `delete` - -Delete an existing Hyperdrive configuration. - -```txt -wrangler hyperdrive delete -``` - -- `ID` string required - - The name of the Hyperdrive configuration to delete. - -### `get` - -Get an existing Hyperdrive configuration. - -```txt -wrangler hyperdrive get -``` - -- `ID` string required - - The name of the Hyperdrive configuration to get. + --- diff --git a/src/content/partials/workers/wrangler-commands/hyperdrive.mdx b/src/content/partials/workers/wrangler-commands/hyperdrive.mdx new file mode 100644 index 00000000000000..2813501a721446 --- /dev/null +++ b/src/content/partials/workers/wrangler-commands/hyperdrive.mdx @@ -0,0 +1,103 @@ +--- +{} +--- + +import { AnchorHeading } from "~/components"; + + + +Create a new Hyperdrive configuration. + +```txt +wrangler hyperdrive create [OPTIONS] +``` + +- `CONFIG_NAME` string required + - The name of the Hyperdrive configuration to create. +- `--connection-string` string optional + - The database connection string in the form `postgres://user:password@hostname:port/database`. +- `--host` string optional + - The hostname or IP address Hyperdrive should connect to. +- `--port` number optional + - The database port to connect to. +- `--scheme` string optional + - The scheme used to connect to the origin database - e.g. postgresql or postgres. +- `--database` string optional + - The database (name) to connect to. For example, Postgres or defaultdb. +- `--user` string optional + - The username used to authenticate to the database. +- `--password` string optional + - The password used to authenticate to the database. +- `--access-client-id` string optional + - 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`. +- `--access-client-secret` string optional + - 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`. +- `--caching-disabled` boolean optional + - Disables the caching of SQL responses. +- `--max-age` number optional + - Specifies max duration for which items should persist in the cache, cannot be set when caching is disabled. +- `--swr` number optional + - Stale While Revalidate - Indicates the number of seconds cache may serve the response after it becomes stale, cannot be set when caching is disabled. + + + +Update an existing Hyperdrive configuration. + +```txt +wrangler hyperdrive update [OPTIONS] +``` + +- `ID` string required + - The ID of the Hyperdrive configuration to update. +- `--name` string optional + - The new name of the Hyperdrive configuration. +- `--origin-host` string optional + - The new database hostname or IP address Hyperdrive should connect to. +- `--origin-port` string optional + - The new database port to connect to. +- `--database` string optional + - The new database (name) to connect to. For example, Postgres or defaultdb. +- `--origin-user` string optional + - The new username used to authenticate to the database. +- `--origin-password` string optional + - The new password used to authenticate to the database. +- `--access-client-id` string optional + - 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`. +- `--access-client-secret` string optional + - 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`. +- `--caching-disabled` boolean optional + - Disables the caching of SQL responses. +- `--max-age` number optional + - Specifies max duration for which items should persist in the cache, cannot be set when caching is disabled. +- `--swr` number optional + - Stale While Revalidate - Indicates the number of seconds cache may serve the response after it becomes stale, cannot be set when caching is disabled. + + + +List all Hyperdrive configurations. + +```txt +wrangler hyperdrive list +``` + + + +Delete an existing Hyperdrive configuration. + +```txt +wrangler hyperdrive delete +``` + +- `ID` string required + - The name of the Hyperdrive configuration to delete. + + + +Get an existing Hyperdrive configuration. + +```txt +wrangler hyperdrive get +``` + +- `ID` string required + - The name of the Hyperdrive configuration to get. diff --git a/src/content/partials/workers/wrangler-commands/kv.mdx b/src/content/partials/workers/wrangler-commands/kv.mdx index 05db3776eeb7d6..0b7dcc78cbb78f 100644 --- a/src/content/partials/workers/wrangler-commands/kv.mdx +++ b/src/content/partials/workers/wrangler-commands/kv.mdx @@ -1,8 +1,9 @@ --- {} - --- +import { AnchorHeading } from "~/components"; + ## `kv namespace` Manage Workers KV namespaces. @@ -17,7 +18,7 @@ The `kv ...` commands allow you to manage your Workers KV resources in the Cloud 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. ::: -### `create` + Create a new namespace. @@ -62,7 +63,7 @@ kv_namespaces = [ ] ``` -### `list` + List all KV namespaces associated with the current account ID. @@ -89,7 +90,7 @@ npx wrangler kv namespace list | jq "." ] ``` -### `delete` + Delete a given namespace. @@ -151,7 +152,7 @@ The `kv ...` commands allow you to manage your Workers KV resources in the Cloud 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. ::: -### `put` + Write a single key-value pair to a particular namespace. @@ -230,7 +231,7 @@ npx wrangler kv key put --binding=MY_KV "my-key" --path=value.txt Writing the contents of value.txt to the key "my-key" on namespace f7b02e7fc70443149ac906dd81ec1791. ``` -### `list` + Output a list of all keys in a given namespace. @@ -276,7 +277,7 @@ npx wrangler kv key list --binding=MY_KV --prefix="public" | jq "." ] ``` -### `get` + Read a single value by key from the given namespace. @@ -316,7 +317,7 @@ npx wrangler kv key get --binding=MY_KV "my-key" value ``` -### `delete` + Remove a single key value pair from the given namespace. @@ -368,7 +369,7 @@ The `kv ...` commands allow you to manage your Workers KV resources in the Cloud 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. ::: -### `put` + Write a JSON file containing an array of key-value pairs to the given namespace. @@ -450,7 +451,7 @@ npx wrangler kv bulk put --binding=MY_KV allthethingsupload.json Success! ``` -### `delete` + Delete all keys read from a JSON file within a given namespace. From f5312617d34cf45e35c8a89241486ab05ca9c486 Mon Sep 17 00:00:00 2001 From: Jun Lee Date: Wed, 18 Sep 2024 15:37:50 +0100 Subject: [PATCH 3/3] Update src/content/partials/workers/wrangler-commands/hyperdrive.mdx Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com> --- src/content/partials/workers/wrangler-commands/hyperdrive.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/partials/workers/wrangler-commands/hyperdrive.mdx b/src/content/partials/workers/wrangler-commands/hyperdrive.mdx index 2813501a721446..b901da8d3e5496 100644 --- a/src/content/partials/workers/wrangler-commands/hyperdrive.mdx +++ b/src/content/partials/workers/wrangler-commands/hyperdrive.mdx @@ -21,7 +21,7 @@ wrangler hyperdrive create [OPTIONS] - `--port` number optional - The database port to connect to. - `--scheme` string optional - - The scheme used to connect to the origin database - e.g. postgresql or postgres. + - The scheme used to connect to the origin database, for example, postgresql or postgres. - `--database` string optional - The database (name) to connect to. For example, Postgres or defaultdb. - `--user` string optional