Neon

From InugamiDev/ultrathink-oss · View interactive version

Neon is an AI agent skill from the GitHub repository InugamiDev/ultrathink-oss. > Serverless Postgres — autoscaling, branching, and HTTP-accessible with zero cold starts.

How to use this skill

Skill file

Neon

Serverless Postgres — autoscaling, branching, and HTTP-accessible with zero cold starts.

When to Use

Core Patterns

Client Setup

import { neon } from "@neondatabase/serverless";

const sql = neon(process.env.DATABASE_URL!);

// Single query — tagged template (returns rows directly)
const users = await sql`SELECT * FROM users WHERE id = ${userId}`;

// Parameterized
const results = await sql`
  SELECT * FROM posts WHERE title ILIKE ${"%" + query + "%"} LIMIT ${limit}
`;

Transactions

import { neon } from "@neondatabase/serverless";

const sql = neon(process.env.DATABASE_URL!);
const tx = sql.transaction([
  sql`UPDATE accounts SET balance = balance - ${amount} WHERE id = ${from}`,
  sql`UPDATE accounts SET balance = balance + ${amount} WHERE id = ${to}`,
]);
await tx; // atomic — all or nothing

WebSocket (Long-lived / Node.js)

import { Pool } from "@neondatabase/serverless";

const pool = new Pool({ connectionString: process.env.DATABASE_URL });
const { rows } = await pool.query("SELECT * FROM users WHERE id = $1", [userId]);
await pool.end();

Drizzle Integration

import { neon } from "@neondatabase/serverless";
import { drizzle } from "drizzle-orm/neon-http";

const sql = neon(process.env.DATABASE_URL!);
const db = drizzle(sql);
const users = await db.select().from(usersTable).where(eq(usersTable.id, id));

Prisma Integration

datasource db {
  provider  = "postgresql"
  url       = env("DATABASE_URL")    // pooled connection
  directUrl = env("DIRECT_URL")      // direct for migrations
}

Key Features

CLI

neonctl projects create --name myapp     # Create project
neonctl branches create --name staging   # Branch from main
neonctl branches reset staging           # Reset branch to parent
neonctl connection-string --branch main  # Get connection URL
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.