Skip to content

Commit 6e538a8

Browse files
committed
clarify that support for mysql-compatible databases in work in progress
1 parent d126e0e commit 6e538a8

File tree

5 files changed

+35
-30
lines changed

5 files changed

+35
-30
lines changed

src/content/docs/hyperdrive/configuration/how-hyperdrive-works.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Hyperdrive supports [`SET` statements](https://www.postgresql.org/docs/current/s
5858

5959
This implies that a single Worker invocation may obtain multiple connections to perform its database operations and may need to `SET` any configurations for every query or transaction. It is not recommended to wrap multiple database operations with a single transaction to maintain the `SET` state. Doing so will affect the performance and scaling of Hyperdrive as the connection cannot be reused by other Worker isolates for the duration of the transaction.
6060

61-
Hyperdrive supports named prepared statements as implemented in the `postgres.js` and `node-postgres` drivers. Named prepared statements in other drivers may have worse performance.
61+
Hyperdrive supports named prepared statements as implemented in the `postgres.js` and `node-postgres` drivers. Named prepared statements in other drivers may have worse performance or may not be supported.
6262

6363
## Related resources
6464

src/content/docs/hyperdrive/examples/connect-to-mysql/aws-rds-aurora.mdx

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
22
type: example
3-
summary: Connect Hyperdrive to an AWS RDS or Aurora database instance.
3+
summary: Connect Hyperdrive to an AWS RDS database instance.
44
pcx_content_type: example
5-
title: AWS RDS and Aurora
5+
title: AWS
66
sidebar:
77
order: 14
8-
description: Connect Hyperdrive to an AWS RDS or Aurora database instance.
8+
description: Connect Hyperdrive to an AWS RDS database instance.
99
---
1010

1111
import { Render } from "~/components";
1212

13-
This example shows you how to connect Hyperdrive to an Amazon Relational Database Service (Amazon RDS) Postgres or Amazon Aurora database instance.
13+
This example shows you how to connect Hyperdrive to an Amazon Relational Database Service (Amazon RDS) MySQL database instance.
1414

1515
## 1. Allow Hyperdrive access
1616

@@ -22,29 +22,20 @@ To allow Hyperdrive to connect to your database, you will need to ensure that Hy
2222

2323
When creating or modifying an instance in the AWS console:
2424

25-
1. Configure a **DB cluster identifier** and other settings you wish to customize.
26-
2. Under **Settings** > **Credential settings**, note down the **Master username** and **Master password** (Aurora only).
27-
3. Under the **Connectivity** header, ensure **Public access** is set to **Yes**.
28-
4. Select an **Existing VPC security group** that allows public Internet access from `0.0.0.0/0` to the port your database instance is configured to listen on (default: `5432` for PostgreSQL instances).
29-
5. Select **Create database**.
25+
1. Configure a **database cluster** and other settings you wish to customize.
26+
2. Under the **Connectivity** header, ensure **Public access** is set to **Yes**.
27+
3. Select an **Existing VPC security group** that allows public Internet access from `0.0.0.0/0` to the port your database instance is configured to listen on (default: `5432` for PostgreSQL instances).
28+
4. Select **Create database**.
3029

3130
:::caution
3231

3332
You must ensure that the [VPC security group](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-security-groups.html) associated with your database allows public IPv4 access to your database port.
3433

35-
Refer to AWS' [database server rules](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules-reference.html#sg-rules-db-server) for details on how to configure rules specific to your RDS or Aurora database.
34+
Refer to AWS' [database server rules](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules-reference.html#sg-rules-db-server) for details on how to configure rules specific to your RDS database.
3635

3736
:::
3837

39-
### Retrieve the database endpoint (Aurora)
40-
41-
To retrieve the database endpoint (hostname) for Hyperdrive to connect to:
42-
43-
1. Go to **Databases** view under **RDS** in the AWS console.
44-
2. Select the database you want Hyperdrive to connect to.
45-
3. Under the **Endpoints** header, note down the **Endpoint name** with the type `Writer` and the **Port**.
46-
47-
### Retrieve the database endpoint (RDS PostgreSQL)
38+
### Retrieve the database endpoint (RDS MySQL)
4839

4940
For regular RDS instances (non-Aurora), you will need to fetch the endpoint and port of the database:
5041

@@ -54,6 +45,12 @@ For regular RDS instances (non-Aurora), you will need to fetch the endpoint and
5445

5546
The endpoint will resemble `YOUR_DATABASE_NAME.cpuo5rlli58m.AWS_REGION.rds.amazonaws.com` and the port will default to `5432`.
5647

48+
:::note[Support for MySQL-compatible providers]
49+
50+
Support for AWS Aurora MySQL databases is coming soon. Join our early preview support by reaching out to us in the [Hyperdrive Discord channel](https://discord.cloudflare.com/).
51+
52+
:::
53+
5754
## 2. Create your user
5855

5956
Once your database is created, you will need to create a user for Hyperdrive to connect as. Although you can use the **Master username** configured during initial database creation, best practice is to create a less privileged user.

src/content/docs/hyperdrive/get-started.mdx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ This guide will instruct you through:
2121

2222
:::note
2323

24-
Hyperdrive currently works with PostgreSQL, MySQL and compatible databases. This includes CockroachDB and Materialize (which are PostgreSQL-compatible), and MariaDB and Planetscale (which are MySQL compatible).
24+
Hyperdrive currently works with PostgreSQL, MySQL and many compatible databases. This includes CockroachDB and Materialize (which are PostgreSQL-compatible), and Planetscale.
25+
26+
Learn more about the [databases that Hyperdrive supports](/hyperdrive/reference/supported-databases-and-features).
2527

2628
:::
2729

@@ -110,13 +112,14 @@ Hyperdrive accepts the combination of these parameters in the common connection
110112
111113
```
112114

113-
Most database providers will provide a connection string you can directly copy-and-paste directly into Hyperdrive.
115+
Most database providers will provide a connection string you can directly copy-and-paste directly into Hyperdrive.
114116

115117
To create a Hyperdrive connection, run the `wrangler` command, replacing the placeholder values passed to the `--connection-string` flag with the values of your existing database:
116118

117119
```sh
118120
npx wrangler hyperdrive create <YOUR_CONFIG_NAME> --connection-string="postgres://user:password@HOSTNAME_OR_IP_ADDRESS:PORT/database_name"
119121
```
122+
120123
</TabItem>
121124
<TabItem label="MySQL">
122125
```txt
@@ -125,19 +128,18 @@ npx wrangler hyperdrive create <YOUR_CONFIG_NAME> --connection-string="postgres:
125128
126129
```
127130

128-
Most database providers will provide a connection string you can directly copy-and-paste directly into Hyperdrive.
131+
Most database providers will provide a connection string you can directly copy-and-paste directly into Hyperdrive.
129132

130-
To create a Hyperdrive connection, run the `wrangler` command, replacing the placeholder values passed to the `--connection-string` flag with the values of your existing database:
133+
To create a Hyperdrive connection, run the `wrangler` command, replacing the placeholder values passed to the `--connection-string` flag with the values of your existing database:
131134

132135
```sh
133136
npx wrangler hyperdrive create <YOUR_CONFIG_NAME> --connection-string="mysql://user:password@HOSTNAME_OR_IP_ADDRESS:PORT/database_name"
134137
```
138+
135139
</TabItem>
136140

137141
</Tabs>
138142

139-
140-
141143
:::note[Manage caching]
142144
By default, Hyperdrive will cache query results. If you wish to disable caching, pass the flag `--caching-disabled`.
143145

@@ -226,7 +228,7 @@ export interface Env {
226228

227229
export default {
228230
async fetch(request, env, ctx): Promise<Response> {
229-
// Create a connection using the Postgres.js driver (or any support driver, ORM or query builder)
231+
// Create a connection using the Postgres.js driver (or any supported driver, ORM or query builder)
230232
// with the Hyperdrive credentials. These credentials are only accessible from your Worker.
231233
const sql = postgres(env.HYPERDRIVE.connectionString, {
232234
// Workers limit the number of concurrent external connections, so be sure to limit

src/content/docs/hyperdrive/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Turn your existing regional database into a globally distributed database.
3232

3333
Hyperdrive is a service that accelerates queries you make to existing databases, making it faster to access your data from across the globe from [Cloudflare Workers](/workers/), irrespective of your users' location.
3434

35-
Hyperdrive supports any Postgres or MySQL database, including those hosted on AWS, Google Cloud, Azure, and Neon. Hyperdrive also supports Postgres-compatible databases like CockroachDB and Timescale and MySQL-compatible databases like MariaDB and Planetscale.
35+
Hyperdrive supports any Postgres or MySQL database, including those hosted on AWS, Google Cloud, Azure, Neon and Planetscale. Hyperdrive also supports Postgres-compatible databases like CockroachDB and Timescale.
3636
You do not need to write new code or replace your favorite tools: Hyperdrive works with your existing code and tools you use.
3737

3838
Use Hyperdrive's connection string from your Cloudflare Workers application with your existing Postgres drivers and object-relational mapping (ORM) libraries:
@@ -180,7 +180,7 @@ Hyperdrive allows you to connect to any PostgreSQL or PostgreSQL-compatible data
180180
181181
<Feature header="MySQL support" href="/hyperdrive/examples/connect-to-mysql/" cta="Connect Hyperdrive to your MySQL database">
182182
183-
Hyperdrive allows you to connect to any MySQL or MySQL-compatible database.
183+
Hyperdrive allows you to connect to any MySQL database.
184184
185185
</Feature>
186186

src/content/docs/hyperdrive/reference/supported-databases-and-features.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ The following is a non-exhaustive list of database providers:
2929
| CockroachDB || All | Postgres-compatible. Refer to the [CockroachDB](/hyperdrive/examples/connect-to-postgres/cockroachdb/) guide to connect. |
3030
| Planetscale || All | Planetscale currently runs MySQL 8.x |
3131

32+
:::note[Support for MySQL-compatible providers]
33+
34+
Support for AWS Aurora MySQL and MariaDB databases is coming soon. Join our early preview support by reaching out to us in the [Hyperdrive Discord channel](https://discord.cloudflare.com/).
35+
36+
:::
37+
3238
## Supported PostgreSQL authentication modes
3339

3440
Hyperdrive supports the following [authentication modes](https://www.postgresql.org/docs/current/auth-methods.html) for connecting to PostgreSQL databases:
@@ -54,7 +60,7 @@ Hyperdrive does not support the following MySQL features:
5460
- Non-UTF8 characters in queries
5561
- `USE` statements
5662
- Multi-statement queries
57-
- Prepared statement queries via SQL (using `PREPARE` and `EXECUTE` statements)
63+
- Prepared statement queries via SQL (using `PREPARE` and `EXECUTE` statements) and [protocol-level prepared statements](https://sidorares.github.io/node-mysql2/docs/documentation/prepared-statements).
5864
- `COM_INIT_DB` messages
5965
- [Authentication plugins](https://dev.mysql.com/doc/refman/8.4/en/authentication-plugins.html) other than `caching_sha2_password` or `mysql_native_password`
6066

0 commit comments

Comments
 (0)