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 fintech company needs a backend service for their analytics dashboard. The service is built with Node.js, TypeScript, and Express, querying a PostgreSQL database via the pg package. The database runs on AWS RDS and is accessible via a DATABASE_URL environment variable. The service will be deployed to production on ECS behind an ALB.
The dashboard needs to support:
Existing tables (already created, no migrations needed):
transactions: id (bigint), customer_id (bigint), amount_cents (numeric(15,2)), status (text), created_at (timestamptz)customers: id (bigint), name (text), email (text)Produce:
db.ts -- Database connection moduleanalytics.ts -- Functions for all four dashboard queriespackage.json -- With required dependenciesThe 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