Neon Serverless Postgres - Complete Reference
This skill provides everything needed to work with Neon serverless Postgres in Next.js/TypeScript applications, with Prisma as the ORM layer.
Quick Reference: Project Setup Checklist
# 1. Install dependencies (Prisma already in project)
npm install @prisma/client
npm install -D prisma
# 2. Set up environment variables (.env)
DATABASE_URL="postgresql://user:pass@ep-xyz-pooler.region.aws.neon.tech/dbname?sslmode=require"
DIRECT_URL="postgresql://user:pass@ep-xyz.region.aws.neon.tech/dbname?sslmode=require"
# 3. Configure prisma/schema.prisma with dual URLs (see references/prisma-integration.md)
# 4. Generate and run migrations
npx prisma migrate dev --name init
npx prisma generate
# 5. (Optional) Set up MCP server for AI-assisted DB management
npx neonctl init
Rule: Use DATABASE_URL (pooled, has -pooler in hostname) for app queries. Use DIRECT_URL (direct, no -pooler) for migrations.
For detailed information on each topic, see the reference files in the references/ directory.