From 9750cf270ac1513b5668f8eaf046c00741f5b35e Mon Sep 17 00:00:00 2001 From: emilio Date: Thu, 10 Oct 2024 13:56:12 -0500 Subject: [PATCH 1/2] Add local development section to Hyperdrive Pages Functions binding --- src/content/docs/pages/functions/bindings.mdx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/content/docs/pages/functions/bindings.mdx b/src/content/docs/pages/functions/bindings.mdx index c30cc22d7bd7e00..010b92c6685b130 100644 --- a/src/content/docs/pages/functions/bindings.mdx +++ b/src/content/docs/pages/functions/bindings.mdx @@ -670,6 +670,21 @@ export const onRequest: PagesFunction = async (context) => { +### Interact with your Hyperdrive configs locally + +You can interact with your Hyperdrive config bindings locally in one of two ways: + +- Give you Hyperdrive binding a `localConnectionString` value in your Pages project's `wrangler.toml` file. +- **Recommended** Export the `WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_` environment variable with the connection string to your database. + +The local runtime will attempt to connect to your database using the connection string you provide with one of the two options above. + +:::note + +For more information about using Hyperdrive locally, see [this page](/hyperdrive/configuration/local-development/). + +::: + ## Analytics Engine The [Analytics Engine](/analytics/analytics-engine/) binding enables you to write analytics within your Pages Function. From 4d7b7926d8638cd28c9f782a16603479b1052ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Assun=C3=A7=C3=A3o?= Date: Thu, 10 Oct 2024 14:09:44 -0500 Subject: [PATCH 2/2] Update src/content/docs/pages/functions/bindings.mdx Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com> --- src/content/docs/pages/functions/bindings.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/pages/functions/bindings.mdx b/src/content/docs/pages/functions/bindings.mdx index 010b92c6685b130..bad2f6430436a0a 100644 --- a/src/content/docs/pages/functions/bindings.mdx +++ b/src/content/docs/pages/functions/bindings.mdx @@ -681,7 +681,7 @@ The local runtime will attempt to connect to your database using the connection :::note -For more information about using Hyperdrive locally, see [this page](/hyperdrive/configuration/local-development/). +For more information about using Hyperdrive locally, see the [local development configuration guide](/hyperdrive/configuration/local-development/). :::