This skill provides comprehensive knowledge for integrating Neon serverless Postgres and Vercel Postgres (built on Neon infrastructure) into web applications. Use it when setting up serverless Postgres databases, configuring connection pooling for edge and serverless environments, implementing database branching workflows, or troubleshooting Postgres connection issues in Cloudflare Workers, Vercel Edge Functions, or Node.js serverless functions. Use this skill when: - Setting up Neon Postgres for Cloudflare Workers, Vercel Edge, or other serverless environments - Configuring Vercel Postgres for Next.js applications - Implementing database branching workflows (git-like database branches) - Integrating Drizzle ORM or Prisma with Neon/Vercel Postgres - Debugging connection pool errors, transaction timeouts, or SSL configuration issues - Migrating from D1/SQLite to Postgres or from traditional Postgres to serverless Postgres - Setting up point-in-time restore (PITR) or database backups - Encountering errors like "connection pool exhausted", "TCP connections not supported in serverless", or "sslmode required" Keywords: neon postgres, @neondatabase/serverless, @vercel/postgres, serverless postgres, postgres edge, neon branching, vercel database, http postgres, websocket postgres, pooled connection, drizzle neon, prisma neon, postgres cloudflare, postgres vercel edge, sql template tag, neonctl, database branches, point in time restore, postgres migrations, serverless sql, edge database, neon api, vercel sql
Status: ✅ Production Ready
Package Versions: @neondatabase/serverless@1.0.2, @vercel/postgres@0.10.0
Last Updated: 2025-10-29
This skill provides comprehensive patterns for integrating Neon serverless Postgres and Vercel Postgres (built on Neon) into serverless and edge environments. It covers both direct Neon usage (multi-cloud, Cloudflare Workers) and Vercel-specific setup (zero-config on Vercel).
Claude should automatically propose this skill when encountering:
@neondatabase/serverless@vercel/postgresneonctldrizzle-orm (with Postgres)@prisma/adapter-neonconnection pool exhaustedTCP connections not supportedsslmode requiredPrismaClient is unable to be run in the browsercloudflare-d1 skill instead)This skill prevents 15 documented errors:
pg client in edge runtime?sslmode=requireclient.release() in manual transactionsDATABASE_URL vs POSTGRES_URL confusionNEON_API_KEY@prisma/adapter-neon for serverlessSources: GitHub issues, official docs, Stack Overflow, production debugging
Estimated Token Savings: ~65% vs manual setup Time to Implement: 5-10 minutes (vs 30-60 minutes without skill)
# Neon Direct (multi-cloud, Cloudflare Workers)
npm install @neondatabase/serverless
# Vercel Postgres (Vercel-specific, zero-config)
npm install @vercel/postgres
# With Drizzle ORM (recommended for edge)
npm install drizzle-orm @neondatabase/serverless
npm install -D drizzle-kit
Neon Direct: Sign up at https://neon.tech → Create project → Copy pooled connection string
Vercel Postgres:
vercel postgres create
vercel env pull .env.local
CRITICAL: Use pooled connection string (ends with -pooler.region.aws.neon.tech)
Neon Direct:
import { neon } from '@neondatabase/serverless';
const sql = neon(process.env.DATABASE_URL!);
const users = await sql`SELECT * FROM users WHERE id = ${userId}`;
Vercel Postgres:
import { sql } from '@vercel/postgres';
const { rows } = await sql`SELECT * FROM users WHERE id = ${userId}`;
templates/neon-basic-queries.ts - Complete raw SQL query patterns (SELECT, INSERT, UPDATE, DELETE, transactions, pagination)templates/drizzle-schema.ts - Production-ready Drizzle schema (users, posts, comments with relations)templates/drizzle-queries.ts - Type-safe Drizzle query patterns (joins, aggregations, prepared statements)templates/drizzle-migrations-workflow.md - Complete migrations guide (generate, review, apply, rollback)templates/package.json - Dependencies and scripts for Neon + Drizzle setupscripts/setup-neon.sh - Creates Neon database and outputs connection stringscripts/test-connection.ts - Verifies database connection and runs test queryreferences/connection-strings.md - Complete guide to pooled vs non-pooled connection stringsreferences/drizzle-setup.md - Step-by-step Drizzle ORM setup with Neonreferences/prisma-setup.md - Prisma setup with @prisma/adapter-neonreferences/branching-guide.md - Comprehensive Neon database branching workflowsreferences/migration-strategies.md - Migration patterns for different ORMsreferences/common-errors.md - Extended troubleshooting guideassets/schema-example.sql - Example database schema (users, posts, comments)assets/drizzle-schema.ts - Complete Drizzle schema template (also in templates/)assets/prisma-schema.prisma - Complete Prisma schema template| Feature | Neon/Vercel Postgres | Cloudflare D1 | Traditional Postgres | Supabase | |---------|----------------------|---------------|---------------------|----------| | Database Type | Postgres | SQLite | Postgres | Postgres | | Edge Compatible | ✅ Yes (HTTP) | ✅ Yes | ❌ No (TCP) | ❌ No (TCP) | | Connection Pooling | ✅ Built-in | N/A | Manual setup | ✅ Built-in | | Branching | ✅ Yes (Neon) | ❌ No | ❌ No | ❌ No | | Auto-scaling | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes | | ORM Support | Drizzle, Prisma | Drizzle | All ORMs | All ORMs | | Best For | Serverless Postgres | Edge SQLite | Traditional apps | Full-stack with auth |
This skill is based on production deployments:
To install this skill:
# From the claude-skills repository root
./scripts/install-skill.sh neon-vercel-postgres
# Verify installation
ls -la ~/.claude/skills/neon-vercel-postgres
MIT License - See LICENSE file for details
SKILL.md for comprehensive setup guidereferences/common-errors.md for troubleshootingLast Updated: 2025-10-29 Verified Package Versions: ✅ Current as of 2025-10-29
npx skills add jackspace/neon-vercel-postgres下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer