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
BIGINT type parser configured
0%
100%
NUMERIC type parser configured
0%
100%
Type parsers before pool creation
0%
100%
SSL configured for production
0%
100%
Pool with production settings
0%
100%
keepAlive enabled
0%
100%
Parameterized queries throughout
100%
100%
ANY for multi-status filter
100%
100%
pool.query for single queries
100%
100%
Pool error handler
0%
100%
Graceful shutdown
0%
100%
Pool with production settings
0%
100%
Parameterized queries throughout
100%
100%
Bulk import uses unnest or multi-row VALUES
100%
100%
ANY or overlap for tag search
100%
100%
ANY for multi-status filter
100%
100%
Foreign key violation handling
50%
100%
RETURNING clause on INSERT/UPDATE
100%
100%
pool.query for single queries
100%
100%
Pool error handler and shutdown
0%
100%
TIMESTAMPTZ in migration
100%
100%
CHECK constraint on status
100%
100%
Index on foreign key
0%
100%
Unique constraint on author email
100%
100%
No individual Client instances
100%
100%
Transaction with BEGIN/COMMIT
100%
100%
ROLLBACK on error
100%
100%
client.release() in finally
100%
100%
pool.connect() for transactions
100%
100%
Pool with production settings
0%
100%
keepAlive enabled
0%
100%
Parameterized queries throughout
100%
100%
RETURNING clause on INSERT
80%
100%
Foreign key constraint handling
0%
100%
Pool error handler
0%
100%
Graceful shutdown
0%
100%
TIMESTAMPTZ in migration
100%
100%
FK index in migration
0%
100%
Pool with production settings
0%
100%
Parameterized queries throughout
100%
100%
Bulk import uses unnest or multi-row VALUES
100%
100%
No loop of individual INSERTs for batch
100%
100%
Typed array casts on unnest or parameters
0%
100%
ANY for tag filtering
70%
100%
ANY for multi-category filter
80%
100%
RETURNING clause on INSERT
100%
100%
pool.query for single queries
100%
100%
Pool error handler
0%
100%
Graceful shutdown
0%
100%
Pool with max connections
0%
100%
Pool timeout settings
0%
100%
keepAlive enabled
0%
100%
Pool error handler
0%
100%
Graceful shutdown
0%
100%
Parameterized queries throughout
100%
100%
pool.query for single queries
100%
100%
RETURNING clause on INSERT/UPDATE
100%
100%
Unique violation handling for email
0%
100%
BIGINT type parser configured
0%
100%
TIMESTAMPTZ in migration
100%
100%
CHECK constraint on role
100%
100%
Index on email column
100%
100%