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 |
templates/local-dev-setup.sh
View on GitHub#!/bin/bash
#
# Hyperdrive Local Development Setup Helper
#
# This script helps set up environment variables for local development
# with Hyperdrive. Use this to avoid committing credentials to wrangler.jsonc.
#
# Usage:
# ./local-dev-setup.sh
# source .env.local # Load variables into current shell
# npm run dev # Start wrangler dev
#
set -e
echo "🚀 Hyperdrive Local Development Setup"
echo ""
# Get binding name from wrangler.jsonc
BINDING_NAME=$(grep -A 2 '"hyperdrive"' wrangler.jsonc | grep '"binding"' | cut -d'"' -f4 | head -1)
if [ -z "$BINDING_NAME" ]; then
echo "❌ Could not find Hyperdrive binding in wrangler.jsonc"
echo " Please ensure you have a hyperdrive configuration with a binding."
exit 1
fi
echo "Found Hyperdrive binding: $BINDING_NAME"
echo ""
# Ask for database details
echo "Enter your local database connection details:"
echo ""
read -p "Database type (postgres/mysql): " DB_TYPE
read -p "Host (default: localhost): " DB_HOST
DB_HOST=${DB_HOST:-localhost}
if [ "$DB_TYPE" = "postgres" ]; then
read -p "Port (default: 5432): " DB_PORT
DB_PORT=${DB_PORT:-5432}
else
read -p "Port (default: 3306): " DB_PORT
DB_PORT=${DB_PORT:-3306}
fi
read -p "Database name: " DB_NAME
read -p "Username: " DB_USER
read -sp "Password: " DB_PASSWORD
echo ""
# Build connection string
if [ "$DB_TYPE" = "postgres" ]; then
CONNECTION_STRING="postgres://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}"
else
CONNECTION_STRING="mysql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}"
fi
# Create .env.local file
ENV_VAR_NAME="CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_${BINDING_NAME}"
cat > .env.local <<EOF
# Hyperdrive Local Development Environment Variables
# Generated on: $(date)
#
# Load these variables before running wrangler dev:
# source .env.local
# npm run dev
#
# DO NOT commit this file to version control!
export ${ENV_VAR_NAME}="${CONNECTION_STRING}"
EOF
# Add to .gitignore
if ! grep -q ".env.local" .gitignore 2>/dev/null; then
echo ".env.local" >> .gitignore
echo "✅ Added .env.local to .gitignore"
fi
echo ""
echo "✅ Created .env.local with environment variable:"
echo " ${ENV_VAR_NAME}"
echo ""
echo "Next steps:"
echo "1. Load the environment variable:"
echo " source .env.local"
echo ""
echo "2. Start local development server:"
echo " npx wrangler dev"
echo ""
echo "3. Your Worker will connect to:"
echo " ${DB_TYPE}://${DB_HOST}:${DB_PORT}/${DB_NAME}"
echo ""
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 |