Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 6 additions & 124 deletions src/content/partials/workers/wrangler-commands/hyperdrive.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,132 +2,14 @@
{}
---

import { AnchorHeading, Type, MetaInfo, Render } from "~/components";
import { AnchorHeading, Type, MetaInfo, Render, WranglerCommand } from "~/components";

<AnchorHeading title="`create`" slug="hyperdrive-create" depth={3} />
<WranglerCommand command="hyperdrive create" />

Create a new Hyperdrive configuration.
<WranglerCommand command="hyperdrive update" />

```txt
wrangler hyperdrive create <CONFIG_NAME> [OPTIONS]
```
<WranglerCommand command="hyperdrive list" />

- `CONFIG_NAME` <Type text="string" /> <MetaInfo text="required" />
- The name of the Hyperdrive configuration to create.
- `--connection-string` <Type text="string" /> <MetaInfo text="optional" />
- The database connection string in the form `postgres://user:password@hostname:port/database`.
- `--origin-host` <Type text="string" /> <MetaInfo text="optional" />
- The hostname or IP address Hyperdrive should connect to.
- `--origin-port` <Type text="number" /> <MetaInfo text="optional" />
- The database port to connect to.
- `--origin-scheme` <Type text="string" /> <MetaInfo text="optional" />
- The scheme used to connect to the origin database, for example, postgresql or postgres.
- `--database` <Type text="string" /> <MetaInfo text="optional" />
- The database (name) to connect to. For example, Postgres or defaultdb.
- `--origin-user` <Type text="string" /> <MetaInfo text="optional" />
- The username used to authenticate to the database.
- `--origin-password` <Type text="string" /> <MetaInfo text="optional" />
- The password used to authenticate to the database.
- `--access-client-id` <Type text="string" /> <MetaInfo text="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` <Type text="string" /> <MetaInfo text="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` <Type text="boolean" /> <MetaInfo text="optional" />
- Disables the caching of SQL responses.
- `--max-age` <Type text="number" /> <MetaInfo text="optional" />
- Specifies max duration for which items should persist in the cache, cannot be set when caching is disabled.
- `--swr` <Type text="number" /> <MetaInfo text="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.
- `--ca-certificate-id` <Type text="string" /> <MetaInfo text="optional" />
- Sets custom CA certificate when connecting to origin database.
- `--mtls-certificate-id` <Type text="string" /> <MetaInfo text="optional" />
- Sets custom mTLS client certificates when connecting to origin database.
- `--sslmode` <Type text="string" /> <MetaInfo text="optional" />
- Sets SSL mode for CA verification. Must be `require` | `verify-ca` | `verify-full`.
- `--origin-connection-limit` <Type text="number" /> <MetaInfo text="optional" />
- The (soft) maximum number of connections that Hyperdrive may establish to the origin database.
<WranglerCommand command="hyperdrive delete" />

<Render file="wrangler-commands/global-flags" product="workers" />

<AnchorHeading title="`update`" slug="hyperdrive-update" depth={3} />

Update an existing Hyperdrive configuration.

```txt
wrangler hyperdrive update <ID> [OPTIONS]
```

- `ID` <Type text="string" /> <MetaInfo text="required" />
- The ID of the Hyperdrive configuration to update.
- `--name` <Type text="string" /> <MetaInfo text="optional" />
- The new name of the Hyperdrive configuration.
- `--connection-string` <Type text="string" /> <MetaInfo text="optional" />
- The database connection string in the form `postgres://user:password@hostname:port/database`.
- `--origin-host` <Type text="string" /> <MetaInfo text="optional" />
- The new database hostname or IP address Hyperdrive should connect to.
- `--origin-port` <Type text="string" /> <MetaInfo text="optional" />
- The new database port to connect to.
- `--origin-scheme` <Type text="string" /> <MetaInfo text="optional" />
- The scheme used to connect to the origin database, for example, postgresql or postgres.
- `--database` <Type text="string" /> <MetaInfo text="optional" />
- The new database (name) to connect to. For example, Postgres or defaultdb.
- `--origin-user` <Type text="string" /> <MetaInfo text="optional" />
- The new username used to authenticate to the database.
- `--origin-password` <Type text="string" /> <MetaInfo text="optional" />
- The new password used to authenticate to the database.
- `--access-client-id` <Type text="string" /> <MetaInfo text="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` <Type text="string" /> <MetaInfo text="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` <Type text="boolean" /> <MetaInfo text="optional" />
- Disables the caching of SQL responses.
- `--max-age` <Type text="number" /> <MetaInfo text="optional" />
- Specifies max duration for which items should persist in the cache, cannot be set when caching is disabled.
- `--swr` <Type text="number" /> <MetaInfo text="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.
- `--ca-certificate-id` <Type text="string" /> <MetaInfo text="optional" />
- Sets custom CA certificate when connecting to origin database.
- `--mtls-certificate-id` <Type text="string" /> <MetaInfo text="optional" />
- Sets custom mTLS client certificates when connecting to origin database.
- `--sslmode` <Type text="string" /> <MetaInfo text="optional" />
- Sets SSL mode for CA verification. Must be `require` | `verify-ca` | `verify-full`.
- `--origin-connection-limit` <Type text="number" /> <MetaInfo text="optional" />
- The (soft) maximum number of connections that Hyperdrive may establish to the origin database.

<Render file="wrangler-commands/global-flags" product="workers" />

<AnchorHeading title="`list`" slug="hyperdrive-list" depth={3} />

List all Hyperdrive configurations.

```txt
wrangler hyperdrive list
```

<Render file="wrangler-commands/global-flags" product="workers" />

<AnchorHeading title="`delete`" slug="hyperdrive-delete" depth={3} />

Delete an existing Hyperdrive configuration.

```txt
wrangler hyperdrive delete <ID>
```

- `ID` <Type text="string" /> <MetaInfo text="required" />
- The name of the Hyperdrive configuration to delete.

<Render file="wrangler-commands/global-flags" product="workers" />

<AnchorHeading title="`get`" slug="hyperdrive-get" depth={3} />

Get an existing Hyperdrive configuration.

```txt
wrangler hyperdrive get <ID>
```

- `ID` <Type text="string" /> <MetaInfo text="required" />
- The name of the Hyperdrive configuration to get.

<Render file="wrangler-commands/global-flags" product="workers" />
<WranglerCommand command="hyperdrive get" />