secondsky/claude-skills / plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive
cloudflare-hyperdrive
VerifiedCloudflare Hyperdrive for Workers-to-database connections with pooling and caching. Use for PostgreSQL/MySQL, Drizzle/Prisma, or encountering pool errors, TLS issues, connection refused.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 7.2 KB |
| references/connection-pooling.md | markdown | 11.5 KB |
| references/drizzle-integration.md | markdown | 12.2 KB |
| references/prisma-integration.md | markdown | 12.8 KB |
| references/query-caching.md | markdown | 12.2 KB |
| references/setup-guide.md | markdown | 2.6 KB |
| references/supported-databases.md | markdown | 11.1 KB |
| references/tls-ssl-setup.md | markdown | 10.5 KB |
| references/troubleshooting.md | markdown | 13.3 KB |
| references/wrangler-commands.md | markdown | 10.6 KB |
| scripts/check-versions.shexecutable | script | 3.4 KB |
| templates/drizzle-mysql.ts | script | 2.2 KB |
| templates/drizzle-postgres.ts | script | 2.1 KB |
| templates/local-dev-setup.shexecutable | script | 2.4 KB |
| templates/mysql2-basic.ts | script | 2.0 KB |
| templates/postgres-basic.ts | script | 1.7 KB |
| templates/postgres-js.ts | script | 2.6 KB |
| templates/postgres-pool.ts | script | 2.4 KB |
| templates/prisma-postgres.ts | script | 3.3 KB |
| templates/wrangler-hyperdrive-config.jsonc | other | 1.0 KB |
references/supported-databases.md
View on GitHub# Supported Databases and Providers
Complete list of databases and providers compatible with Cloudflare Hyperdrive.
---
## Database Engine Support
| Engine | Supported | Versions | Notes |
|--------|-----------|----------|-------|
| **PostgreSQL** | ✅ Yes | 9.0 - 17.x | Both self-hosted and managed |
| **MySQL** | ✅ Yes | 5.7 - 8.x | Both self-hosted and managed, MariaDB included |
| **SQL Server** | ❌ No | - | Not currently supported |
| **MongoDB** | ❌ No | - | NoSQL not supported (use Atlas Data API) |
| **Oracle** | ❌ No | - | Not currently supported |
---
## PostgreSQL-Compatible Databases
### AWS RDS / Aurora PostgreSQL
**Status**: ✅ Fully Supported
**Connection Example**:
```bash
npx wrangler hyperdrive create aws-postgres \
--connection-string="postgres://admin:password@mydb.abc123.us-east-1.rds.amazonaws.com:5432/postgres"
```
**SSL**: Enabled by default on RDS
**Guide**: [AWS RDS Guide](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-database-providers/aws-rds-aurora/)
---
### Google Cloud SQL (PostgreSQL)
**Status**: ✅ Fully Supported
**Connection Example**:
```bash
npx wrangler hyperdrive create gcp-postgres \
--connection-string="postgres://postgres:password@34.123.45.67:5432/mydb"
```
**Public IP**: Must enable public IP in Cloud SQL settings
**Guide**: [Google Cloud SQL Guide](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-database-providers/google-cloud-sql/)
---
### Azure Database for PostgreSQL
**Status**: ✅ Fully Supported
**Connection Example**:
```bash
npx wrangler hyperdrive create azure-postgres \
--connection-string="postgres://myuser@myserver:password@myserver.postgres.database.azure.com:5432/mydb"
```
**Firewall**: Add Cloudflare IP ranges or allow all public IPs
**Guide**: [Azure PostgreSQL Guide](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-database-providers/azure/)
---
### Neon
**Status**: ✅ Fully Supported
**Connection Example**:
```bash
npx wrangler hyperdrive create neon-db \
--connection-string="postgres://user:password@ep-cool-darkness-123456.us-east-2.aws.neon.tech:5432/neondb"
```
**Driver**: Use `pg` or `postgres.js` (NOT @neondatabase/serverless driver)
**Guide**: [Neon Guide](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-database-providers/neon/)
---
### Supabase
**Status**: ✅ Fully Supported
**Connection Example**:
```bash
npx wrangler hyperdrive create supabase-db \
--connection-string="postgres://postgres:password@db.abc123xyz.supabase.co:5432/postgres"
```
**Connection String**: Get from Supabase Dashboard → Settings → Database → Connection string (Direct connection)
**Guide**: [Supabase Guide](https://developers.cloudflare.com/workers/databases/third-party-integrations/supabase/)
---
### PlanetScale (PostgreSQL)
**Status**: ✅ Fully Supported
**Connection Example**:
```bash
npx wrangler hyperdrive create planetscale-postgres \
--connection-string="postgres://user:password@aws.connect.psdb.cloud:3306/mydb"
```
**Driver**: Use `pg` or `postgres.js` (NOT PlanetScale serverless driver)
**Guide**: [PlanetScale Guide](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-database-providers/planetscale-postgres/)
---
### Timescale
**Status**: ✅ Fully Supported
**Connection Example**:
```bash
npx wrangler hyperdrive create timescale-db \
--connection-string="postgres://tsdbadmin:password@abc123xyz.tsdb.cloud.timescale.com:5432/tsdb"
```
**Guide**: [Timescale Guide](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-database-providers/timescale/)
---
### CockroachDB
**Status**: ✅ Fully Supported
**Connection Example**:
```bash
npx wrangler hyperdrive create cockroach-db \
--connection-string="postgres://user:password@free-tier.gcp-us-central1.cockroachlabs.cloud:26257/defaultdb"
```
**Notes**: PostgreSQL-compatible, uses port 26257
**Guide**: [CockroachDB Guide](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-database-providers/cockroachdb/)
---
### Materialize
**Status**: ✅ Fully Supported
**Connection Example**:
```bash
npx wrangler hyperdrive create materialize-db \
--connection-string="postgres://user@materialize.example.com:6875/materialize"
```
**Guide**: [Materialize Guide](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-database-providers/materialize/)
---
### Fly.io PostgreSQL
**Status**: ✅ Fully Supported
**Connection Example**:
```bash
npx wrangler hyperdrive create fly-postgres \
--connection-string="postgres://postgres:password@my-app-db.fly.dev:5432/postgres"
```
**Guide**: [Fly.io Guide](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-database-providers/fly/)
---
### pgEdge Cloud
**Status**: ✅ Fully Supported
**Connection Example**:
```bash
npx wrangler hyperdrive create pgedge-db \
--connection-string="postgres://user:password@db.pgedge.io:5432/mydb"
```
**Guide**: [pgEdge Guide](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-database-providers/pgedge/)
---
### Prisma Postgres
**Status**: ✅ Fully Supported
**Connection Example**:
```bash
npx wrangler hyperdrive create prisma-postgres \
--connection-string="postgres://user:password@db.prisma.io:5432/mydb"
```
**Guide**: [Prisma Postgres Guide](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-database-providers/prisma-postgres/)
---
## MySQL-Compatible Databases
### AWS RDS / Aurora MySQL
**Status**: ✅ Fully Supported
**Connection Example**:
```bash
npx wrangler hyperdrive create aws-mysql \
--connection-string="mysql://admin:password@mydb.abc123.us-east-1.rds.amazonaws.com:3306/mydb"
```
**Guide**: [AWS RDS MySQL Guide](https://developers.cloudflare.com/hyperdrive/examples/connect-to-mysql/mysql-database-providers/aws-rds-aurora/)
---
### Google Cloud SQL (MySQL)
**Status**: ✅ Fully Supported
**Connection Example**:
```bash
npx wrangler hyperdrive create gcp-mysql \
--connection-string="mysql://root:password@34.123.45.67:3306/mydb"
```
**Guide**: [Google Cloud SQL MySQL Guide](https://developers.cloudflare.com/hyperdrive/examples/connect-to-mysql/)
---
### Azure Database for MySQL
**Status**: ✅ Fully Supported
**Connection Example**:
```bash
npx wrangler hyperdrive create azure-mysql \
--connection-string="mysql://myuser@myserver:password@myserver.mysql.database.azure.com:3306/mydb"
```
**Guide**: [Azure MySQL Guide](https://developers.cloudflare.com/hyperdrive/examples/connect-to-mysql/mysql-database-providers/azure/)
---
### PlanetScale (MySQL)
**Status**: ✅ Fully Supported
**Connection Example**:
```bash
npx wrangler hyperdrive create planetscale-mysql \
--connection-string="mysql://user:password@aws.connect.psdb.cloud:3306/mydb"
```
**Driver**: Use `mysql2` (NOT PlanetScale serverless driver)
---
### MariaDB
**Status**: ✅ Fully Supported
**Connection Example**:
```bash
npx wrangler hyperdrive create mariadb \
--connection-string="mysql://user:password@mariadb-host:3306/mydb"
```
**Notes**: MariaDB uses MySQL protocol, fully compatible
---
## Self-Hosted Databases
### Self-Hosted PostgreSQL
**Status**: ✅ Fully Supported
**Requirements**:
- PostgreSQL 9.0+
- SSL/TLS enabled
- Public IP address (or use Cloudflare Tunnel for private)
- Firewall configured to allow public connections
**postgresql.conf**:
```conf
listen_addresses = '*'
ssl = on
ssl_cert_file = 'server.crt'
ssl_key_file = 'server.key'
```
**pg_hba.conf**:
```conf
# Allow connections from anywhere with SSL
hostssl all all 0.0.0.0/0 md5
```
---
### Self-Hosted MySQL
**Status**: ✅ Fully Supported
**Requirements**:
- MySQL 5.7+
- SSL/TLS enabled
- Public IP address (or use Cloudflare Tunnel)
- Firewall configured
**my.cnf**:
```conf
[mysqld]
bind-address = 0.0.0.0
require_secure_transport = ON
ssl-ca = ca-cert.pem
ssl-cert = server-cert.pem
ssl-key = server-key.pem
```
---
## Private Database Access
### Cloudflare Tunnel
For databases in private networks (VPCs, on-premises):
**Supported**:
- Private AWS VPCs
- Google Cloud private networks
- Azure VNets
- On-premises databases
- Any database behind firewall
**Setup**:
1. Install cloudflared
2. Create tunnel to database
3. Configure Hyperdrive with tunnel hostname
**Guide**: [Cloudflare Tunnel Guide](https://developers.cloudflare.com/hyperdrive/configuration/connect-to-private-database/)
---
## Connection Requirements
### All Databases MUST Have
✅ **TLS/SSL enabled** - Hyperdrive requires encryption
✅ **Accessible endpoint** - Public IP or via Cloudflare Tunnel
✅ **User permissions** - User must have read/write permissions
✅ **Correct credentials** - Valid username/password
✅ **Firewall configured** - Allow connections from internet or tunnel
### All Databases CANNOT Have
❌ **Private IP only** (10.x.x.x, 192.168.x.x) - Use Tunnel instead
❌ **SSL disabled** - Hyperdrive requires TLS
❌ **Restrictive firewall** - Must allow Cloudflare connections
❌ **Invalid credentials** - Connection will fail during setup
---
## Unsupported Databases
| Database | Status | Alternative |
|----------|--------|-------------|
| **MongoDB** | ❌ Not Supported | Use MongoDB Atlas Data API or Realm |
| **SQL Server** | ❌ Not Supported | Use Azure SQL Edge (Linux) or wait for support |
| **Oracle Database** | ❌ Not Supported | No current alternative |
| **SQLite** | ❌ Not Needed | Use Cloudflare D1 (serverless SQLite) |
| **Redis** | ❌ Not Supported | Use Upstash Redis or Cloudflare KV |
| **DynamoDB** | ❌ Not Supported | Use AWS SDK directly or Cloudflare KV |
| **Cassandra** | ❌ Not Supported | Use DataStax Astra DB API |
---
## Choosing a Database Provider
### For New Projects
**Recommended**:
1. **Neon** - Serverless PostgreSQL, generous free tier
2. **Supabase** - PostgreSQL + Auth + Storage
3. **PlanetScale** - MySQL, branching workflow
4. **Cloudflare D1** - If you don't need PostgreSQL/MySQL features
### For Existing Apps
Use Hyperdrive with your current provider:
- AWS RDS/Aurora
- Google Cloud SQL
- Azure Database
### For Self-Hosted
Use Cloudflare Tunnel for secure private access.
---
## Performance Comparison
| Provider | Connection Latency | Query Latency | Caching |
|----------|-------------------|---------------|---------|
| **Neon** (US-East) | ~5ms | ~10-20ms | ✅ Yes |
| **Supabase** (US-East) | ~5ms | ~10-20ms | ✅ Yes |
| **AWS RDS** (US-East) | ~5ms | ~15-25ms | ✅ Yes |
| **Self-Hosted** (EU) | ~50ms | ~60-80ms | ✅ Yes |
**Note**: Hyperdrive adds minimal latency (~5ms) but eliminates 7 round trips, resulting in net performance gain.
---
## References
- [Supported Databases Docs](https://developers.cloudflare.com/hyperdrive/reference/supported-databases-and-features/)
- [PostgreSQL Examples](https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/)
- [MySQL Examples](https://developers.cloudflare.com/hyperdrive/examples/connect-to-mysql/)
- [Private Database Guide](https://developers.cloudflare.com/hyperdrive/configuration/connect-to-private-database/)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| Agent Cost Reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| Agent Cost Reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |