Agent skill · software engineering · secondsky

cloudflare-hyperdrive

Cloudflare Hyperdrive for Workers-to-database connections with pooling and caching. Use for PostgreSQL/MySQL, Drizzle/Prisma, or encountering pool errors, TLS issues, connection refused.

Why this skill is useful

Provides specific commands and configurations for optimizing database connections in Cloudflare Workers that the AI wouldn't reliably generate on its own.

What it needs

Requires bun installed locally. About 4k tokens when loaded. Last updated 2026-08-06. 204 stars on the source repository.

What this skill does

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 latency Works with node-postgres, postgres.js, mysql2 --- Quick Start (5 Minutes) 1. Create Hyperdrive Config Save the id! 2. Configure Binding 3. Install Driver 4. Query Database Load references/setup-guide.md for complete walkthrough. --- Critical Rules Always Do ✅ 1. Enable nodejscompat flag (required!) 2. Use env.HYPERDRIVE.connectionString (not original DB string) 3. Close connections after queries 4. Handle errors explicitly 5. Use connection pooling (built-in) 6. Test locally with wrangler dev 7. Monitor query performance 8. Use prepared statements 9. Enable query caching (automatic) 10. Secure connection strings (use secrets) Never Do ❌ 1. Never skip nodejscompat (drivers won't work) 2. Never use original DB connection string in Workers 3. Never leave connections open (pool exhaustion) 4. Never skip error handling (DB can fail) 5. Never hardcode credentials in code 6. Never exceed connection limits 7. Never use eval/Function (blocked in Workers) 8. Never skip TLS for production DBs 9. Never use blocking queries (Worker timeout) 10. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills secondsky/cloudflare-hyperdrive

View the source on GitHub

Browse the @skills marketplace