home / skills / xfstudio / skills / neon-postgres
This skill helps you configure Neon Postgres patterns for serverless apps, including Prisma, Drizzle, and PgBouncer pooling, with separate URLs for migrations.
npx playbooks add skill xfstudio/skills --skill neon-postgresReview the files below or copy the command above to add this skill to your agents.
---
name: neon-postgres
description: "Expert patterns for Neon serverless Postgres, branching, connection pooling, and Prisma/Drizzle integration Use when: neon database, serverless postgres, database branching, neon postgres, postgres serverless."
source: vibeship-spawner-skills (Apache 2.0)
---
# Neon Postgres
## Patterns
### Prisma with Neon Connection
Configure Prisma for Neon with connection pooling.
Use two connection strings:
- DATABASE_URL: Pooled connection for Prisma Client
- DIRECT_URL: Direct connection for Prisma Migrate
The pooled connection uses PgBouncer for up to 10K connections.
Direct connection required for migrations (DDL operations).
### Drizzle with Neon Serverless Driver
Use Drizzle ORM with Neon's serverless HTTP driver for
edge/serverless environments.
Two driver options:
- neon-http: Single queries over HTTP (fastest for one-off queries)
- neon-serverless: WebSocket for transactions and sessions
### Connection Pooling with PgBouncer
Neon provides built-in connection pooling via PgBouncer.
Key limits:
- Up to 10,000 concurrent connections to pooler
- Connections still consume underlying Postgres connections
- 7 connections reserved for Neon superuser
Use pooled endpoint for application, direct for migrations.
## ⚠️ Sharp Edges
| Issue | Severity | Solution |
|-------|----------|----------|
| Issue | high | See docs |
| Issue | high | See docs |
| Issue | high | See docs |
| Issue | medium | See docs |
| Issue | medium | See docs |
| Issue | low | See docs |
| Issue | medium | See docs |
| Issue | high | See docs |
This skill documents expert patterns for using Neon serverless Postgres with Prisma and Drizzle, plus guidance on connection pooling and branching. It focuses on practical configuration: pooled app connections, direct migration connections, and selecting the right Neon drivers for serverless or edge environments. Use it to avoid common pitfalls and scale serverless Postgres safely.
The guide explains using two connection strings: a pooled DATABASE_URL for application queries via PgBouncer and a DIRECT_URL for direct connections needed by migrations and DDL. It also maps Drizzle driver choices (neon-http vs neon-serverless) to transaction and latency characteristics. Finally, it outlines Neon’s pooling limits and reserved connections so you can size and instrument your app correctly.
Why two connection strings instead of one?
Use the pooled connection for runtime to protect Postgres from too many direct connections. Use the direct connection for migrations and DDL because PgBouncer can block some schema-changing commands.
Which Drizzle driver should I pick for serverless functions?
Pick neon-http for the fastest, stateless single-query calls. Choose neon-serverless when you need transactions, multi-statement sessions, or lower-latency session handling.