cloudflare-hyperdrive
Cloudflare Hyperdrive bridges Workers to PostgreSQL and MySQL databases using global connection pooling and automatic query caching. It works with popular drivers like node-postgres, postgres.js, and mysql2, plus ORMs like Drizzle and Prisma, eliminating pool exhaustion and connection errors while cutting latency.
Cloudflare Hyperdrive connects Workers to PostgreSQL or MySQL databases with built-in connection pooling and query caching.
AI-generated summary based on this skill's SKILL.md
Install
secondsky/claude-skills/cloudflare-hyperdrive · repository language: TypeScript
git clone https://github.com/secondsky/claude-skills
cp -r claude-skills/plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive ~/.claude/skills/cloudflare-hyperdrivenpx skillfed install secondsky/claude-skills/cloudflare-hyperdriveFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What is Cloudflare Hyperdrive and how does it work with Workers?
Cloudflare Hyperdrive bridges Cloudflare Workers to PostgreSQL and MySQL databases using global connection pooling and automatic query caching. It eliminates pool exhaustion and connection errors while cutting latency by maintaining persistent connections across your distributed Workers fleet, supporting drivers like node-postgres, postgres.js, and mysql2, plus ORMs such as Drizzle and Prisma.
How do I set up hyperdrive postgres connection pooling in Workers?
Hyperdrive connection pooling in Workers is configured via wrangler.toml bindings that point to your PostgreSQL instance. Create a Hyperdrive binding, specify your database credentials and connection parameters, then access it in your Worker code via the binding name. Hyperdrive automatically manages a global connection pool, preventing exhaustion and connection refused errors that plague direct database connections.
Can I use Drizzle ORM with Hyperdrive bindings in Cloudflare Workers?
Yes, Cloudflare Hyperdrive integrates seamlessly with Drizzle ORM. Configure your Drizzle client to use the Hyperdrive binding as its connection source, and Drizzle will leverage Hyperdrive's pooling and caching automatically. This combination provides type-safe queries with connection pool management and reduced latency out of the box.
How does hyperdrive query caching reduce database latency in Workers?
Hyperdrive implements automatic query caching that stores frequently-accessed results at Cloudflare's edge, dramatically reducing round-trips to your origin database. Combined with global connection pooling, this caching layer cuts latency by serving cached responses from nearby edge locations instead of querying your database every time, especially beneficial for read-heavy workloads.
What should I do if I get postgres workers connection refused errors?
Connection refused errors typically indicate pool exhaustion or misconfigured credentials. Hyperdrive resolves this by managing a global connection pool that prevents exhaustion. Verify your database credentials in wrangler.toml, ensure the nodejs_compat flag is enabled if using Node.js drivers, and confirm your database allows inbound connections from Cloudflare's IP ranges for production deployments.
How do I set up TLS/SSL for secure database connections with Hyperdrive?
Cloudflare Hyperdrive supports TLS/SSL configuration through wrangler.toml settings where you specify your database's SSL certificate requirements. For production, enable TLS enforcement in your Hyperdrive binding configuration to encrypt all traffic between Workers and your database. This ensures secure connections whether you're using PostgreSQL, MySQL, or managed services like Neon or Supabase.
SKILL.md
rendered from the published skill — quoted content, verbatim
Cloudflare Hyperdrive
Status: Production Ready ✅ | Last Verified: 2025-11-18
What Is Hyperdrive?
Connect Workers to existing PostgreSQL/MySQL databases: - Global connection pooling - Query caching - Reduced
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 15 files
plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive/SKILL.md
plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive/references/connection-pooling.md
plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive/references/drizzle-integration.md
plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive/references/prisma-integration.md
plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive/references/query-caching.md
plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive/references/setup-guide.md
plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive/references/supported-databases.md
plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive/references/tls-ssl-setup.md
plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive/references/troubleshooting.md
plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive/references/wrangler-commands.md
plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive/scripts/check-versions.sh
plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive/templates/drizzle-mysql.ts
plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive/templates/drizzle-postgres.ts
plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive/templates/local-dev-setup.sh
plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive/templates/mysql2-basic.ts