Skip to content

Commit 8b87bb0

Browse files
authored
Correctly referencing HYPERDRIVE variable in the (#22010)
example code.
1 parent 8bff05f commit 8b87bb0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Hyperdrive accepts the combination of these parameters in the common connection
107107
<Tabs>
108108
<TabItem label="PostgreSQL">
109109
```txt
110-
110+
111111
postgres://USERNAME:PASSWORD@HOSTNAME_OR_IP_ADDRESS:PORT/database_name
112112
113113
```
@@ -292,11 +292,11 @@ export default {
292292
// Create a connection using the mysql2 driver (or any support driver, ORM or query builder)
293293
// with the Hyperdrive credentials. These credentials are only accessible from your Worker.
294294
const connection = await createConnection({
295-
host: env.DB_HOST,
296-
user: env.DB_USER,
297-
password: env.DB_PASSWORD,
298-
database: env.DB_NAME,
299-
port: env.DB_PORT
295+
host: env.HYPERDRIVE.host,
296+
user: env.HYPERDRIVE.user,
297+
password: env.HYPERDRIVE.password,
298+
database: env.HYPERDRIVE.database,
299+
port: env.HYPERDRIVE.port
300300

301301
// The following line is needed for mysql2 compatibility with Workers
302302
// mysql2 uses eval() to optimize result parsing for rows with > 100 columns

0 commit comments

Comments
 (0)