Skip to content
Open
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
27 changes: 27 additions & 0 deletions docs/content/docs/2.database/1.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,33 @@ Configure replicas in your `nuxt.config.ts`:
:::
::

### Cloudflare Hyperdrive

When using Cloudflare Hyperdrive, you first have to set up Hyperdrive in Cloudflare and set the generated ID in `nuxt.config.ts`:

```ts [nuxt.config.ts]
export default defineNuxtConfig({
hub: {
db: {
dialect: 'postgresql',
connection: {
hyperdriveId: '<your-hyperdrive-id>',
},
},
},
})
```

With this, NuxtHub will apply migrations on build to the configured database connection.

::tip
Use direct database connection string instead of pooling when configuring Hyperdrive.
::

::warning
We've [open issue](https://github.com/nuxt-hub/core/issues/869) regarding migrations don't apply when `db.connection.hyperdriveId` is set, so for now (v0.10.8+) you have to also pass direct database connection string with `DATABASE_URL`, `POSTGRES_URL` or relevant environment variable when building the application to ensure migrations are applied.
Comment thread
jd-solanki marked this conversation as resolved.
::
Comment thread
jd-solanki marked this conversation as resolved.

## AI Agents

If you work with an IDE that supports AI agents, you can add the following text in your `Agents.md` or `.cursor/rules` file:
Expand Down