> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sinas.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Database Connections

> External database connections

Database connections store credentials and manage connection pools for external databases.

**Supported databases:** PostgreSQL, ClickHouse, Snowflake

**Key properties:**

| Property                                           | Description                                      |
| -------------------------------------------------- | ------------------------------------------------ |
| `name`                                             | Unique connection name                           |
| `connection_type`                                  | `postgresql`, `clickhouse`, or `snowflake`       |
| `host`, `port`, `database`, `username`, `password` | Connection details                               |
| `ssl_mode`                                         | Optional SSL configuration                       |
| `config`                                           | Pool settings (`min_pool_size`, `max_pool_size`) |

Passwords are encrypted at rest. Connection pools are managed automatically and invalidated when settings change.

**Endpoints (admin only):**

```
POST   /api/v1/database-connections                    # Create connection
GET    /api/v1/database-connections                    # List connections
GET    /api/v1/database-connections/{name}             # Get by name
PATCH  /api/v1/database-connections/{id}               # Update
DELETE /api/v1/database-connections/{id}               # Delete
POST   /api/v1/database-connections/test               # Test raw connection params
POST   /api/v1/database-connections/{id}/test          # Test saved connection
```
