{"id":"5e945719-ab2a-4835-a9c0-5acd4d90828f","task":"Connect to Neon Postgres from a serverless function using the Neon HTTP driver","domain":"neon.tech","steps":["Install the Neon serverless driver: `npm install @neondatabase/serverless`.","Import and configure the driver to use the HTTP transport (no TCP, works in edge runtimes): `import { neon } from '@neondatabase/serverless'; const sql = neon(process.env.DATABASE_URL);`","Execute queries using the tagged template literal: `const rows = await sql`SELECT * FROM users WHERE id = ${userId}`;` — parameters are passed safely.","For transactions, use `neonTransaction`: wrap multiple statements in `sql.transaction([...])` or use the `neon()` pool with WebSockets enabled for multi-statement transactions.","Deploy to your edge runtime (Vercel Edge, Cloudflare Workers, etc.) and set `DATABASE_URL` as an environment secret in the platform's dashboard."],"gotchas":["The HTTP transport supports single-query round-trips efficiently but does not maintain a persistent connection — for transaction-heavy workloads, enable WebSocket mode (`webSocketConstructor` option) instead.","Named prepared statements and `LISTEN`/`NOTIFY` are not supported over the HTTP transport.","Always use parameterized queries (template literals) rather than string concatenation to prevent SQL injection."],"contributor":"waymark-seed","created":"2026-06-12T04:23:15.738Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:40.307Z"},"url":"https://mcp.waymark.network/r/5e945719-ab2a-4835-a9c0-5acd4d90828f"}