neon_skill
- Python
13
GitHub Stars
2
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill bobmatnyc/claude-mpm-skills --skill neon- metadata.json919 B
- SKILL.md19.6 KB
Overview
This skill packages guidance and examples for using Neon serverless Postgres with autoscaling, instant branching, and zero-downtime deployments. It focuses on practical integrations with ORMs (Drizzle, Prisma), raw pg usage, serverless drivers, and deployment platforms like Vercel and Netlify. Use the recipes to provision branches, configure pooling, and run safe migrations for serverless apps.
How this skill works
The skill explains Neon architecture (projects, databases, branches, compute, storage) and shows concrete connection and pooling patterns (pooled DATABASE_URL vs DIRECT_URL for migrations). It provides code snippets for Drizzle, Prisma, node-postgres and Neon's serverless driver, plus CLI/API commands to create branches, set compute limits, and provision read replicas. It also covers branch workflows for feature development, preview deployments, and point-in-time recovery.
When to use it
- Building edge or serverless applications where connections scale to zero
- Implementing branch-based development, preview environments, or per-PR databases
- Running migrations or schema changes safely with a direct connection
- Deploying on Vercel/Netlify and needing preview databases per deployment
- Using Drizzle, Prisma, or raw pg in a serverless runtime
Best practices
- Use pooled connection strings (PgBouncer) for application queries and DIRECT_URL for migrations
- Create short-lived branches for feature work and preview deployments, then delete when done
- Configure compute per branch: scale-to-zero for dev, minimal baseline for staging, always-on for production
- Run zero-downtime migrations: add nullable columns, backfill, then make non-nullable and swap
- Cache or reuse Neon's serverless driver connections in edge runtimes (fetchConnectionCache=true)
Example use cases
- Create a preview branch per GitHub PR and set DATABASE_URL in CI to run tests against an isolated database
- Deploy a Next.js edge API that queries Neon via @neondatabase/serverless with pooled connections
- Run Prisma/Drizzle migrations using DIRECT_URL while application uses pooled DATABASE_URL
- Create read replicas for heavy read traffic and route reads to replicas while writes go to primary
- Restore production state by creating a branch from a timestamp and testing migrations there before resetting main
FAQ
Use the pooled (PgBouncer) DATABASE_URL for application queries in serverless/edge runtimes. Use DIRECT_URL for migrations and admin tasks that require a direct Postgres connection.
How do I get instant isolated databases for PR previews?
Create a Neon branch from main on deploy (CLI/API/Console). Neon branches are instant because storage is separated from compute; set the branch's DATABASE_URL for the preview environment.