Skip to content

Commit 9842349

Browse files
gwenshapOxyjun
authored andcommitted
Add Hyperdrive example with Nile database (#18374)
* Adding Hyperdrive example with Nile database * small style change * Update Nile's hyperdrive doc per Oxyjun suggestions Co-authored-by: Jun Lee <[email protected]> * Update Nile's hyperdrive doc per Oxyjun suggestions Co-authored-by: Jun Lee <[email protected]> * Update Nile's hyperdrive doc per Oxyjun suggestions Co-authored-by: Jun Lee <[email protected]> * Update Nile's hyperdrive doc per Oxyjun suggestions Co-authored-by: Jun Lee <[email protected]> * Update Nile's hyperdrive example per thomasgauvin feedback --------- Co-authored-by: Jun Lee <[email protected]>
1 parent 29938ff commit 9842349

File tree

1 file changed

+46
-0
lines changed
  • src/content/docs/hyperdrive/examples

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
type: example
3+
summary: Connect Hyperdrive to a Nile database instance.
4+
pcx_content_type: example
5+
title: Connect to Nile
6+
sidebar:
7+
order: 3
8+
description: Connect Hyperdrive to a Nile database instance.
9+
---
10+
11+
import { Render } from "~/components";
12+
13+
This example shows you how to connect Hyperdrive to a [Nile](https://thenile.dev) PostgreSQL database instance.
14+
15+
Nile is PostgreSQL re-engineered for multi-tenant applications. Nile's virtual tenant databases provide you with isolation, placement, insight, and other features for your tenant's data and embedding. Refer to [Nile documentation](https://www.thenile.dev/docs/getting-started/whatisnile) to learn more.
16+
17+
## 1. Allow Hyperdrive access
18+
19+
You can connect Cloudflare Hyperdrive to any Nile database in your workspace using its connection string - either with a new set of credentials, or using an existing set.
20+
21+
### Nile console
22+
23+
To get a connection string from Nile console:
24+
25+
1. Log in to [Nile console](https://console.thenile.dev), then select a database.
26+
2. On the left hand menu, click **Settings** (the bottom-most icon) and then select **Connection**.
27+
3. Select the PostgreSQL logo to show the connection string.
28+
4. Select **Generate credentials** to generate new credentials.
29+
5. Copy the connection string (without the "psql" part).
30+
31+
You will have obtained a connection string similar to the following:
32+
33+
```txt
34+
postgres://0191c898-...:[email protected]:5432/my_database
35+
```
36+
37+
With the connection string, you can now create a Hyperdrive database configuration.
38+
39+
## 2. Create a database configuration
40+
41+
<Render file="create-hyperdrive-config" />
42+
43+
44+
45+
46+

0 commit comments

Comments
 (0)