Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions src/content/docs/hyperdrive/examples/nile.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
type: example
summary: Connect Hyperdrive to a Nile database instance.
pcx_content_type: example
title: Connect to Nile
sidebar:
order: 3
description: Connect Hyperdrive to a Nile database instance.
---

import { Render } from "~/components";

This example shows you how to connect Hyperdrive to a [Nile](https://thenile.dev) PostgreSQL database instance.

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.

## 1. Allow Hyperdrive access

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.

### Nile console

To get a connection string from Nile console:

1. Log in to [Nile console](https://console.thenile.dev), then select a database.
2. On the left hand menu, click **Settings** (the bottom-most icon) and then select **Connection**.
3. Select the PostgreSQL logo to show the connection string.
4. Select **Generate credentials** to generate new credentials.
5. Copy the connection string (without the "psql" part).

You will have obtained a connection string similar to the following:

```txt
postgres://0191c898-...:[email protected]:5432/my_database
```

With the connection string, you can now create a Hyperdrive database configuration.

## 2. Create a database configuration

<Render file="create-hyperdrive-config" />





Loading