using-neon

Guides setup, connection, and management of Neon Serverless Postgres databases.

30.5k|3.5k|Updated Jul 4, 2025
One-click install
npx skills add https://github.com/davila7/claude-code-templates --skill using-neon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-neon
Source: https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/database/using-neon
Command: npx skills add https://github.com/davila7/claude-code-templates --skill using-neon

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Working with Neon Serverless Postgres involves many decisions—choosing the right connection driver for your platform, setting up authentication, managing branches, and using the Platform API—and getting any of these wrong leads to connection failures, poor performance, or security issues.

Core Features & Use Cases

  • Connection Method Selection: Decision tree for picking the right driver (TCP, HTTP, WebSocket) based on platform (Vercel, Cloudflare, Netlify, Railway) and transaction requirements.
  • Auth & Data API Setup: Integration patterns for @neondatabase/auth and @neondatabase/neon-js with Next.js, React SPA, and Node.js backends.
  • Platform Management: Guidance for the Neon CLI, TypeScript SDK, Python SDK, and REST API to manage projects, branches, endpoints, and roles programmatically.
  • Use Case: A developer deploying a Next.js app to Vercel can follow the skill to configure connection pooling with @vercel/functions, set up Drizzle ORM, and create preview branches per pull request.

Quick Start

Ask the assistant to help you connect your project to a Neon database and recommend the right driver for your deployment platform.

Frequently Asked Questions about using-neon

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

FAQPage Schema
How do I connect to a Neon database from Vercel serverless functions?

Use the pg driver with @vercel/functions and call attachDatabasePool on your Pool instance to enable connection pooling in Vercel's Fluid compute. For edge runtimes without TCP support, use @neondatabase/serverless over HTTP or WebSocket instead.

What is the difference between @neondatabase/auth and @neondatabase/neon-js?

@neondatabase/auth provides authentication only with a smaller bundle size, while @neondatabase/neon-js combines auth with the PostgREST-style Data API for database queries. Choose neon-js when you need both sign-in flows and client-side data queries.

Does the Neon serverless driver support SQL transactions?

Yes, but the transport matters. HTTP queries support non-interactive transactions via sql.transaction(), while interactive transactions with BEGIN/COMMIT require a WebSocket connection using Pool from @neondatabase/serverless.

How do I create a Neon database branch for preview deployments?

Use the Neon CLI with neonctl branches create, the TypeScript SDK's createProjectBranch method, or the REST API POST /projects/{project_id}/branches endpoint. Branches are instant copy-on-write clones ideal for per-PR preview environments.

Why does my Neon database have a cold start delay on first query?

Neon scales to zero after a period of inactivity (default 5 minutes), so the first query after suspension incurs roughly 500ms of cold start latency. You can configure the suspend timeout or keep compute active for latency-sensitive workloads.