neon-serverless

द्वारा neondatabase

Neon Serverless Driver को Next.js, Vercel Edge Functions, AWS Lambda और अन्य सर्वरलेस वातावरणों के लिए कॉन्फ़िगर करता है। @neondatabase/serverless इंस्टॉल करता है, सेटअप करता है…

npx skills add https://github.com/neondatabase/ai-rules --skill neon-serverless

Neon Serverless Skill

Configures the Neon Serverless Driver for optimal performance in serverless and edge computing environments.

When to Use

  • Setting up connections for edge functions (Vercel Edge, Cloudflare Workers)
  • Configuring serverless APIs (AWS Lambda, Google Cloud Functions)
  • Optimizing for low-latency database access
  • Implementing connection pooling for high-throughput apps

Not recommended for: Complex multi-statement transactions (use WebSocket Pool), persistent servers (use native PostgreSQL drivers), or offline-first applications.

Code Generation Rules

When generating TypeScript/JavaScript code:

  • BEFORE generating import statements, check tsconfig.json for path aliases (compilerOptions.paths)
  • If path aliases exist (e.g., "@/": ["./src/"]), use them (e.g., import { x } from '@/lib/utils')
  • If NO path aliases exist or unsure, ALWAYS use relative imports (e.g., import { x } from '../../../lib/utils')
  • Verify imports match the project's configuration
  • Default to relative imports - they always work regardless of configuration

Reference Documentation

Primary Resource: See [neon-serverless.mdc](https://raw.githubusercontent.com/neondatabase-labs/ai-rules/main/neon-serverless.mdc) in project root for comprehensive guidelines including:

  • Installation and compatibility requirements
  • HTTP vs WebSocket adapter selection
  • Connection pooling strategies
  • Query optimization patterns
  • Error handling and troubleshooting

Quick Setup

Installation

npm install @neondatabase/serverless

Connection Patterns

HTTP Client (recommended for edge/serverless):

import { neon } from '@neondatabase/serverless';
const sql = neon(process.env.DATABASE_URL!);
const rows = await sql`SELECT * FROM users WHERE id = ${userId}`;

WebSocket Pool (for Node.js long-lived connections):

import { Pool } from '@neondatabase/serverless';
const pool = new Pool({ connectionString: process.env.DATABASE_URL! });
const result = await pool.query('SELECT * FROM users WHERE id = $1', [userId]);

See templates/ for complete examples:

  • templates/http-connection.ts - HTTP client setup
  • templates/websocket-pool.ts - WebSocket pool configuration

Validation

Use scripts/validate-connection.ts to test your database connection before deployment.

Related Skills

  • neon-auth - Add authentication
  • neon-js - Full SDK with auth + data API
  • neon-drizzle - For ORM with serverless connections
  • neon-toolkit - For ephemeral database testing

Want best practices in your project? Run neon-plugin:add-neon-docs with parameter SKILL_NAME="neon-serverless" to add reference links.

neondatabase की और Skills

claimable-postgres
neondatabase
स्थानीय विकास, डेमो, प्रोटोटाइपिंग और परीक्षण वातावरण के लिए तत्काल Postgres डेटाबेस। खाते की आवश्यकता नहीं है। डेटाबेस 72 घंटे के बाद समाप्त हो जाते हैं जब तक कि किसी Neon खाते में दावा न किया जाए।
neon
neondatabase
Neon प्लेटफ़ॉर्म का अवलोकन, जो ऐप्स और एजेंटों के लिए Postgres, Auth, Data API, और नई सेवाओं: Object Storage, Compute Functions, और AI Gateway को शामिल करता है। जब भी "Neon" का उल्लेख हो, इसका उपयोग Neon के साथ काम करने और शुरू करने के तरीके के अवलोकन के लिए करें। अन्यथा, व्यक्तिगत क्षमताएँ ट्रिगर हैं: "object storage" या "S3-compatible storage", "serverless functions", "background jobs", या "run code near my database", "AI gateway", "LLM proxy", "model routing", या "call an LLM" →...
apidatabasedevelopment
plugin-manager
neondatabase
इस रिपॉजिटरी के लिए Cursor और Claude Code दोनों में प्लगइन संरचना और कॉन्फ़िगरेशन प्रबंधित करें। प्लगइन फ़ोल्डर बनाते, अपडेट करते या समीक्षा करते समय उपयोग करें…
skill-creator
neondatabase
प्रभावी कौशल बनाने के लिए मार्गदर्शिका। इस कौशल का उपयोग तब किया जाना चाहिए जब उपयोगकर्ता एक नया कौशल बनाना (या मौजूदा कौशल को अपडेट करना) चाहते हैं जो Claude की क्षमताओं को बढ़ाता है…
using-neon
neondatabase
Neon Serverless Postgres के साथ काम करने के लिए मार्गदर्शिकाएँ और सर्वोत्तम अभ्यास। इसमें आरंभ करना, Neon के साथ स्थानीय विकास, कनेक्शन विधि चुनना, Neon… शामिल है।
neon-js-react
neondatabase
React ऐप्स (Vite, CRA) में प्रमाणीकरण और डेटाबेस क्वेरी के साथ पूर्ण Neon SDK सेट करता है। टाइप किया गया क्लाइंट बनाता है, डेटाबेस प्रकार उत्पन्न करता है, और कॉन्फ़िगर करता है…
postgres-best-practices
neondatabase
पोस्टग्रेस के साथ काम करने के लिए सर्वोत्तम प्रथाएँ और दिशानिर्देश। इसमें स्कीमा डिज़ाइन, इंडेक्सिंग रणनीतियाँ, क्वेरी ऑप्टिमाइज़ेशन, माइग्रेशन और सामान्य समस्याएँ शामिल हैं। उपयोग…
neon-postgres-egress-optimizer
neondatabase
उपयोगकर्ता को उनके Postgres डेटाबेस से अत्यधिक डेटा स्थानांतरण (एग्रेस) का कारण बनने वाले एप्लिकेशन-साइड क्वेरी पैटर्न के निदान और सुधार में मार्गदर्शन करें। अधिकांश उच्च एग्रेस बिल एप्लिकेशन द्वारा आवश्यकता से अधिक डेटा लाने के कारण आते हैं।