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
Decision gist · record as of 2026-07-25
Cloudflare Hyperdrive connects Workers to PostgreSQL or MySQL databases with built-in connection pooling and query caching. 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.
Use it when
- Hyperdrive connection pooling in Workers is configured via wrangler.toml bindings that point to your PostgreSQL instance.
- Yes, Cloudflare Hyperdrive integrates seamlessly with Drizzle ORM.
Verify before relying
Read SKILL.md below before installing (20 files). Open directory: indexed for reading, not audited.
Install
secondsky/claude-skills/cloudflare-hyperdrive · repository language: TypeScript
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently 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)
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
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Connect Cloudflare Workers to PostgreSQL or MySQL databases with pooling”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
Nuxthub extends Nuxt with backend services including a type-safe database layer via Drizzle ORM (supporting SQLite, PostgreSQL, and MySQL), key-value storage, file blob storage, and caching. It handles schema definition, migrations, and multi-cloud deployment across Cloudflare, Vercel, Deno, and Netlify with virtual module imports for seamless server-side access.
Cloudflare Knowledge equips you with patterns and templates for building on the Cloudflare edge platform—Workers, Pages, R2, D1, KV, Durable Objects, and Workers AI. Reference guides cover wrangler configuration, storage service trade-offs, AI model selection, and Zero Trust setup.
This skill equips you to build and deploy applications on Cloudflare's edge network using Workers, a serverless platform supporting JavaScript, TypeScript, and WebAssembly. It covers environment bindings, storage services (KV for caching, D1 for SQL, R2 for objects), Durable Objects for stateful coordination, and Wrangler CLI for local development and deployment.
Wrangler is Cloudflare's command-line tool for building and deploying Workers across the edge platform. It handles local development, deployment, and management of Workers alongside bindings for KV storage, R2 buckets, D1 databases, Vectorize indexes, and Workers AI. The skill prioritizes current documentation over cached knowledge to ensure commands and config syntax stay accurate.
Master performance tuning for Cloudflare Workers through CPU optimization, memory management, and strategic caching. Learn to profile hot paths, stream large payloads, batch operations, and minimize cold starts while staying within platform limits.
This skill streamlines Cloudflare D1 database setup by automating wrangler configuration, binding management, and migration workflows. It's built for developers using Claude Code CLI who need rapid database provisioning with minimal manual configuration overhead.