
Neon Postgres
Wire a solo SaaS or API to Neon serverless Postgres with correct pooling, migrations, and Prisma or Drizzle patterns.
Overview
Neon Postgres is an agent skill for the Build phase that configures Neon serverless Postgres with pooling, branching, and Prisma/Drizzle integration patterns.
Install
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill neon-postgresWhat is this skill?
- Dual URL pattern: pooled DATABASE_URL for app traffic and DIRECT_URL for Prisma Migrate DDL
- PgBouncer pooler endpoint documented for high connection counts on serverless
- Prisma schema datasource with url + directUrl and singleton PrismaClient pattern
- Coverage of Neon branching and serverless Postgres operational patterns
- Prisma and Drizzle integration guidance in one skill
- Documents pooled connections scaling to on the order of 10K connections via PgBouncer
- Uses two connection strings: DATABASE_URL (pooled) and DIRECT_URL (migrations)
Adoption & trust: 586 installs on skills.sh; 40.1k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You picked Neon for Postgres but your agent keeps using one connection string and breaks migrations or saturates connections in serverless.
Who is it for?
Solo builders deploying a Node/Prisma or Drizzle app to Vercel, Fly, or similar with Neon as the primary database.
Skip if: Teams on self-managed Postgres only, or apps with no SQL/ORM layer where this integration surface does not apply.
When should I use this skill?
Setting up or fixing Neon Postgres with Prisma/Drizzle, branching, or serverless connection pooling.
What do I get? / Deliverables
After the skill runs, you have pooled and direct URLs, ORM datasource config, and client setup aligned with Neon’s serverless model.
- .env connection string pair for pooled and direct Neon access
- prisma/schema.prisma datasource with url and directUrl
- Singleton PrismaClient module pattern for serverless
Recommended Skills
Journey fit
Database and ORM setup belongs on the Build shelf because it happens while implementing the product backend, before ship hardening. Backend is the canonical home for connection strings, schema models, and server-side data access—not launch SEO or ops monitoring.
How it compares
Skill-encoded Neon + ORM recipes, not a generic “install PostgreSQL locally” checklist.
Common Questions / FAQ
Who is neon-postgres for?
Solo and indie builders implementing backend data layers on Neon with Prisma or Drizzle and agent-assisted coding.
When should I use neon-postgres?
During Build when you scaffold schema, env vars, and clients for Neon—especially before first migrate/deploy and when debugging pooler versus direct connection errors.
Is neon-postgres safe to install?
Source is marked safe in SKILL metadata; review the Security Audits panel on this Prism page and avoid committing real DATABASE_URL secrets into repos.
SKILL.md
READMESKILL.md - Neon Postgres
# Neon Postgres Expert patterns for Neon serverless Postgres, branching, connection pooling, and Prisma/Drizzle integration ## 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). ### Code_example # .env # Pooled connection for application queries DATABASE_URL="postgres://user:password@ep-xxx-pooler.us-east-2.aws.neon.tech/neondb?sslmode=require" # Direct connection for migrations DIRECT_URL="postgres://user:password@ep-xxx.us-east-2.aws.neon.tech/neondb?sslmode=require" // prisma/schema.prisma generator client { provider = "prisma-client-js" } datasource db { provider = "postgresql" url = env("DATABASE_URL") directUrl = env("DIRECT_URL") } model User { id String @id @default(cuid()) email String @unique name String? createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } // lib/prisma.ts import { PrismaClient } from '@prisma/client'; const globalForPrisma = globalThis as unknown as { prisma: PrismaClient | undefined; }; export const prisma = globalForPrisma.prisma ?? new PrismaClient({ log: process.env.NODE_ENV === 'development' ? ['query', 'error', 'warn'] : ['error'], }); if (process.env.NODE_ENV !== 'production') { globalForPrisma.prisma = prisma; } // Run migrations // Uses DIRECT_URL automatically npx prisma migrate dev npx prisma migrate deploy ### Anti_patterns - Pattern: Using pooled connection for migrations | Why: DDL operations fail through PgBouncer | Fix: Set directUrl in schema.prisma - Pattern: Not using connection pooling | Why: Serverless functions exhaust connection limits | Fix: Use -pooler endpoint in DATABASE_URL ### References - https://neon.com/docs/guides/prisma - https://www.prisma.io/docs/orm/overview/databases/neon ### 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 ### Code_example # Install dependencies npm install drizzle-orm @neondatabase/serverless npm install -D drizzle-kit // lib/db/schema.ts import { pgTable, serial, text, timestamp } from 'drizzle-orm/pg-core'; export const users = pgTable('users', { id: serial('id').primaryKey(), email: text('email').notNull().unique(), name: text('name'), createdAt: timestamp('created_at').defaultNow().notNull(), updatedAt: timestamp('updated_at').defaultNow().notNull(), }); // lib/db/index.ts (for serverless - HTTP driver) import { neon } from '@neondatabase/serverless'; import { drizzle } from 'drizzle-orm/neon-http'; import * as schema from './schema'; const sql = neon(process.env.DATABASE_URL!); export const db = drizzle(sql, { schema }); // Usage in API route import { db } from '@/lib/db'; import { users } from '@/lib/db/schema'; export async function GET() { const allUsers = await db.select().from(users); return Response.json(allUsers); } // lib/db/index.ts (for WebSocket - transactions) import { Pool } from '@neondatabase/serverless'; import { drizzle } from 'drizzle-orm/neon-serverless'; import * as schema from './schema'; const pool = new Pool({ connectionString: process.env.DATABASE_URL }); export const db = drizzle(pool, { schema }); // With transactions await db.transaction(async (tx) => { await tx.insert(users).values({ email: 'test@example.com' }); await tx.update(users).set({ name: 'Updated