name: neon description: Neon serverless PostgreSQL integration using @neondatabase/serverless. Use when implementing database operations with Neon.
Neon Integration
Neon is a serverless PostgreSQL database.
Guidelines
Use the
@neondatabase/serverlesspackage to interact with a Neon database.Use the
neon(...)function to create a reusable SQL client:import { neon } from '@neondatabase/serverless' const sql = neon(process.env.DATABASE_URL)NEVER use the
@vercel/postgrespackage to interact with a Neon database.Use parameterized queries to prevent SQL injection.
Environment Variables
DATABASE_URL- Neon connection string
Example Usage
import { neon } from '@neondatabase/serverless'
const sql = neon(process.env.DATABASE_URL)
// Query example
const users = await sql`SELECT * FROM users WHERE id = ${userId}`
// Insert example
await sql`INSERT INTO users (name, email) VALUES (${name}, ${email})`