SPB Git

spb/search-box Public

Agentic web research engine — hypotheses, verbatim evidence, contradictions, sourced answers streamed live. Claude Opus 5 + Firecrawl + PostgreSQL.

TypeScript 76.9% CSS 18.7% SQL 2.1% JavaScript 1.8% Shell 0.5%
488 B · 21 lines typescript
Raw Blame History
1/**2 * Search-box.ai3 * Author: Simon-Pierre Boucher4 * Contact: contact@spboucher.ai5 * File: packages/db/src/pool.ts6 * Description: Singleton PostgreSQL connection pool.7 */89import pg from "pg";1011let pool: pg.Pool | null = null;1213export function getPool(): pg.Pool {14  if (!pool) {15    const connectionString = process.env.DATABASE_URL;16    if (!connectionString) throw new Error("DATABASE_URL is not set");17    pool = new pg.Pool({ connectionString, max: 10 });18  }19  return pool;20}21