Skip to content

Commit 3d36513

Browse files
committed
thomasgauvin: nits & notes for local dev
1 parent 96c6b11 commit 3d36513

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/content/docs/hyperdrive/configuration/local-development.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ sidebar:
77

88
import { WranglerConfig } from "~/components";
99

10-
Hyperdrive can be used when developing and testing your Workers locally by connecting to any local database instance running on your machine directly. Local development uses [Wrangler](/workers/wrangler/install-and-update/), the command-line interface for Workers, to manage local development sessions and state.
10+
Hyperdrive can be used when developing and testing your Workers locally by connecting to a local database instance running on your machine directly or a remote database instance. Local development uses [Wrangler](/workers/wrangler/install-and-update/), the command-line interface for Workers, to manage local development sessions and state.
1111

12-
## Configure local development
13-
14-
:::note
12+
:::note[Note]
1513

16-
This guide assumes you are using `wrangler` version `3.27.0` or later.
14+
You can connect to a local development for local development using the local connection string configurations for Wrangler as detailed below. This allows you to connect to a local database instance running on your machine directly.
1715

18-
If you are new to Hyperdrive and/or Cloudflare Workers, refer to [Hyperdrive tutorial](/hyperdrive/get-started/) to install `wrangler` and deploy their first database.
16+
You can also connect to a remote development for local development using the `npx wrangler dev --remote` command, which will use the remote database configured for your Hyperdrive configuration.
1917

2018
:::
2119

20+
## Configure local development
21+
2222
To specify a database to connect to when developing locally, you can:
2323

24-
- **Recommended** Create a `WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_<BINDING_NAME>` environmental variable with the connection string of your database. `<BINDING_NAME>` is the name of the binding assigned to your Hyperdrive in your [Wrangler configuration file](/workers/wrangler/configuration/) or Pages configuration. This allows you to avoid committing potentially sensitive credentials to source control in your Wrangler configuration file, if your test/development database is not ephemeral. If you have configured multiple Hyperdrive bindings, replace `<BINDING_NAME>` with the unique binding name for each.
24+
- **Recommended:** Create a `WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_<BINDING_NAME>` environmental variable with the connection string of your database. `<BINDING_NAME>` is the name of the binding assigned to your Hyperdrive in your [Wrangler configuration file](/workers/wrangler/configuration/) or Pages configuration. This allows you to avoid committing potentially sensitive credentials to source control in your Wrangler configuration file, if your test/development database is not ephemeral. If you have configured multiple Hyperdrive bindings, replace `<BINDING_NAME>` with the unique binding name for each.
2525
- Set `localConnectionString` in the Wrangler configuration file.
2626

2727
If both the `WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_<BINDING_NAME>` environmental variable and `localConnectionString` in the Wrangler configuration file are set, `wrangler dev` will use the environmental variable instead. Use `unset WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_<BINDING_NAME>` to unset any existing environmental variables.

0 commit comments

Comments
 (0)