# DatabaseConnection

> Credentials.

Credentials. Reading this is audited and needs `db:connect`; agents need approval in protected environments.

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `database_id` * | string |  |
| `host` * | string |  |
| `port` * | integer |  |
| `user` * | string |  |
| `password` * | string |  |
| `database` * | string |  |
| `url` * | string | Pooled connection string (what services get as `DATABASE_URL`). |
| `direct_url` | string | Direct connection string (`DATABASE_URL_DIRECT`). |
| `sslmode` | string |  |
| `expires_at` | string (date-time) or null | Set for short-lived dynamic credentials. |

\* always present

## Example

```json
{
  "database_id": "string",
  "host": "string",
  "port": 1,
  "user": "string",
  "password": "string",
  "database": "string",
  "url": "string",
  "direct_url": "string",
  "sslmode": "require",
  "expires_at": "2026-10-22T13:05:00Z"
}
```

## Used by

- [Connection credentials (gated, audited)](/docs/api/databases/#connection-credentials-gated-audited)
