home / skills / andrelandgraf / fullstackrecipes / neon-drizzle-setup
This skill helps you connect a Next.js app to Neon Postgres using Drizzle ORM with optimized serverless pooling for Vercel.
npx playbooks add skill andrelandgraf/fullstackrecipes --skill neon-drizzle-setupReview the files below or copy the command above to add this skill to your agents.
---
name: neon-drizzle-setup
description: Connect a Next.js app to Neon Postgres using Drizzle ORM with optimized connection pooling for Vercel serverless functions.
---
# Neon + Drizzle Setup
To set up Neon + Drizzle Setup, refer to the fullstackrecipes MCP server resource:
**Resource URI:** `recipe://fullstackrecipes.com/neon-drizzle-setup`
If the MCP server is not configured, fetch the recipe directly:
```bash
curl -H "Accept: text/plain" https://fullstackrecipes.com/api/recipes/neon-drizzle-setup
```
This skill bundles a tested setup to connect a Next.js app to Neon Postgres using Drizzle ORM, with connection pooling tuned for Vercel serverless environments. It provides a clear pattern, TypeScript examples, and deployment-ready configuration so serverless functions use stable pooled connections and avoid cold-start connection storms. The goal is reliable, low-latency DB access in production-grade full-stack AI apps.
The setup wires Drizzle ORM into Next.js API routes and server components while using Neon’s connection pooling guidance to reuse clients across invocations. It exports a singleton pool/client instance that survives across Vercel function warm cycles, and includes environment-driven configuration for connection limits, timeouts, and SSL. The recipe also provides commands and an alternative fetch endpoint to retrieve the canonical instructions.
Where can I find the full step-by-step recipe?
Fetch the recipe from the published resource URI or retrieve it via curl at https://fullstackrecipes.com/api/recipes/neon-drizzle-setup.
Do I need a special Neon plan to use pooling?
Basic pooling works on most plans, but adjust pool size and timeouts to match your Neon account limits and expected concurrency.
Is this pattern compatible with Next.js server components and API routes?
Yes. The pattern supports both server components and API routes by exposing a reusable pooled client that can be imported where needed.