Skip to content

Commit 9750cf2

Browse files
committed
Add local development section to Hyperdrive Pages Functions binding
1 parent f3e4869 commit 9750cf2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/content/docs/pages/functions/bindings.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,21 @@ export const onRequest: PagesFunction<Env> = async (context) => {
670670

671671
</TabItem> </Tabs>
672672

673+
### Interact with your Hyperdrive configs locally
674+
675+
You can interact with your Hyperdrive config bindings locally in one of two ways:
676+
677+
- Give you Hyperdrive binding a `localConnectionString` value in your Pages project's `wrangler.toml` file.
678+
- **Recommended** Export the `WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_<BINDING_NAME>` environment variable with the connection string to your database.
679+
680+
The local runtime will attempt to connect to your database using the connection string you provide with one of the two options above.
681+
682+
:::note
683+
684+
For more information about using Hyperdrive locally, see [this page](/hyperdrive/configuration/local-development/).
685+
686+
:::
687+
673688
## Analytics Engine
674689

675690
The [Analytics Engine](/analytics/analytics-engine/) binding enables you to write analytics within your Pages Function.

0 commit comments

Comments
 (0)