cloudflare-hyperdrive

Connect Cloudflare Workers to PostgreSQL and MySQL databases via Hyperdrive.

961|99|Updated Oct 20, 2025
One-click install
npx skills add https://github.com/jezweb/claude-skills --skill cloudflare-hyperdrive
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-hyperdrive
Source: https://github.com/jezweb/claude-skills/tree/main/skills/cloudflare-hyperdrive
Command: npx skills add https://github.com/jezweb/claude-skills --skill cloudflare-hyperdrive

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires wrangler, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill eliminates the complexity of connecting Cloudflare Workers to existing PostgreSQL and MySQL databases, saving you from endless configuration and troubleshooting.

Core Features & Use Cases

  • Global Connection Pooling: Eliminates 7 round trips (TCP + TLS + auth) with edge-based pooling near your database.

Quick Start

Create a Hyperdrive configuration for your PostgreSQL database and connect your Worker to query data immediately.

Core Features & Use Cases

  • Query Caching: Automatically caches read queries at the edge for faster responses.
  • Use Case: When you need to connect your Worker to an existing AWS RDS PostgreSQL instance to fetch user data.

Frequently Asked Questions about cloudflare-hyperdrive

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect a Cloudflare Worker to a PostgreSQL or MySQL database?

Connection pooling with Hyperdrive lets you connect Workers to PostgreSQL and MySQL databases using edge-based global pooling. Configure a Hyperdrive instance pointing to your database, then query it from your Worker using node-postgres, postgres.js, mysql2, Drizzle ORM, or Prisma.

What is connection pooling and why does it matter for Workers?

Connection pooling reuses database connections across requests instead of creating new ones, eliminating 7 round trips (TCP, TLS, authentication). Hyperdrive's edge pooling significantly reduces latency and connection overhead when Workers query databases.

Can I use Hyperdrive with my existing AWS RDS database?

Yes, Hyperdrive works with existing PostgreSQL and MySQL databases including AWS RDS instances. Configure Hyperdrive with your database credentials and connection details, then connect your Worker to query data immediately without modifying your existing database setup.

Does Hyperdrive support prepared statements and ORM frameworks?

Hyperdrive supports prepared statements for query caching and integrates with major ORM drivers including Drizzle ORM and Prisma, plus database libraries like node-postgres and mysql2. This enables efficient, cacheable queries from Workers.

What are the connection pool limits and constraints for Workers with Hyperdrive?

Hyperdrive enforces a 5-connection pool cap per Worker. Use prepared statements and ctx.waitUntil for non-blocking cleanup. TLS/SSL enforcement is required; avoid eval() statements since they're disallowed in Worker environments.

How do I troubleshoot pool acquisition failures or TLS errors with Hyperdrive?

Pool acquisition failures and TLS errors typically arise from misconfigured credentials, connection limits, or TLS settings. Verify your Hyperdrive configuration matches your database requirements, ensure TLS/SSL is properly enabled, and check that your Worker respects the 5-connection pool cap.