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 SaaS startup is building a user management service for their platform. The service is built with Node.js, TypeScript, and Express, using PostgreSQL as the database (accessed via the pg package). The database is already running and accessible via a DATABASE_URL environment variable.
The service needs to support:
Each user has: id (bigint primary key), name, email (unique), role, created_at, and updated_at.
Produce:
db.ts -- Database connection moduleusers.ts -- Functions for all five user operations listed abovepackage.json -- With required dependenciesmigrations/001_create_users.sql -- SQL migration to create the users tableThe 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