PostgreSQL patterns for Node.js with pg — connection pooling, parameterized
99
99%
Does it follow best practices?
Impact
100%
1.75xAverage score across 5 eval scenarios
Passed
No known issues
A media company is building a content publishing platform backend with Node.js, TypeScript, and Express. The service uses PostgreSQL via the pg package. The database is accessible via a DATABASE_URL environment variable.
The platform needs to support:
Tables needed:
authors: id (serial), name, email (unique), created_atarticles: id (serial), title, body (text), author_id (FK to authors), status, tags (text[]), published_at (nullable), created_at, updated_atProduce:
db.ts -- Database connection modulearticles.ts -- Functions for all six operations listed abovepackage.json -- With required dependenciesmigrations/001_create_tables.sql -- SQL migration for both tablesThe code should be complete TypeScript with no placeholders or TODO comments.
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
skills
postgresql-node-best-practices
verifiers