neon-postgres

Guides setup, connection, branching, and migration workflows for Neon serverless Postgres databases.

Updated Sep 2, 2026
One-click install
npx skills add https://github.com/ZubairImtiaz3/Safar-E-Iman-Portal --skill neon-postgres-zubairimtiaz3
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: neon-postgres
Source: https://github.com/ZubairImtiaz3/Safar-E-Iman-Portal/tree/main/.agents/skills/neon-postgres
Command: npx skills add https://github.com/ZubairImtiaz3/Safar-E-Iman-Portal --skill neon-postgres-zubairimtiaz3

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Configuring and operating a serverless Postgres database involves many decisions—pooled versus direct connections, driver selection per runtime, branching strategies, and migration safety—that are easy to get wrong and cause subtle production failures. ## Core Features & Use Cases - Connection Guidance: Provides decision rules for pooled versus direct connections and recommends drivers like @neondatabase/serverless, node-postgres, and Drizzle ORM based on the runtime (Vercel, Cloudflare, Netlify). - Branching & Migrations: Explains copy-on-write branches for isolated environments and testing schema migrations against production-like data before applying them. - Scaling & Operations: Covers autoscaling, scale-to-zero, instant restore, read replicas, connection pooling with PgBouncer, IP allow lists, and logical replication. - Use Case: A developer deploying a Next.js app on Vercel needs a DATABASE_URL, the right Postgres driver, and a safe migration workflow; this Skill walks through project selection, connection string retrieval, and branch-based migration testing. ## Quick Start Ask the assistant to set up a Neon project, retrieve the DATABASE_URL connection string, and recommend the right Postgres driver for your deployment platform.

Frequently Asked Questions about neon-postgres

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect to a Neon Postgres database?

Use the Neon CLI or MCP server to select a project and retrieve the connection string, storing it as DATABASE_URL in your .env file. Then pick a driver based on your runtime, such as @neondatabase/serverless for edge environments or node-postgres for long-running servers.

Should I use pooled or direct connections with Neon?

Use the pooled connection (hostname with -pooler suffix) for application query traffic, especially serverless workloads. Use the direct connection for schema migrations, pg_dump, logical replication, LISTEN/NOTIFY, and anything relying on session state like SET commands.

Why do Prisma migrations fail on Neon with prepared statement errors?

Running migrations over the pooled connection fails because PgBouncer transaction mode does not support session-level operations, producing errors like prepared statement already exists. Point your migration tool's direct URL setting, such as Prisma's directUrl, at the unpooled connection string.

How do I test schema migrations safely on Neon?

Create an instant copy-on-write branch of your production database and run the migration there against production-like data first. Once validated, apply the migration to production using a direct, non-pooled connection string.

Does Neon scale to zero when idle?

Yes, idle computes suspend automatically after a default of 5 minutes, and the timeout is configurable. The first query after suspension incurs a cold-start penalty of a few hundred milliseconds, while storage remains active throughout.