CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-pg-native

A slightly nicer interface to Postgres over node-libpq providing both sync and async operations

88

1.20x

Quality

Pending

Does it follow best practices?

Impact

88%

1.20x

Average score across 10 eval scenarios

Overview
Eval results
Files

rubric.jsonevals/scenario-10/

{
  "context": "This criteria evaluates how well the engineer uses the node-postgres (pg) package's connection pooling features, specifically focusing on the maxUses configuration parameter for automatic connection recycling. The evaluation assesses proper use of Pool class, pool configuration options, and connection lifecycle management.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Pool instantiation",
      "description": "Creates a Pool instance using the Pool constructor from the pg package (e.g., new Pool(config) or require('pg').Pool)",
      "max_score": 15
    },
    {
      "name": "maxUses configuration",
      "description": "Configures the pool with the maxUses parameter set to limit connection reuse (e.g., maxUses: 10 in the pool configuration object)",
      "max_score": 25
    },
    {
      "name": "max parameter",
      "description": "Sets the max parameter to configure the maximum number of connections in the pool (e.g., max: 5)",
      "max_score": 10
    },
    {
      "name": "idleTimeoutMillis configuration",
      "description": "Configures idleTimeoutMillis parameter for idle connection timeout (e.g., idleTimeoutMillis: 5000)",
      "max_score": 10
    },
    {
      "name": "Pool.query method",
      "description": "Uses pool.query() method for executing queries with automatic connection checkout and release",
      "max_score": 20
    },
    {
      "name": "Pool.end method",
      "description": "Uses pool.end() method to gracefully shut down the pool and close all connections",
      "max_score": 15
    },
    {
      "name": "Async/await or promises",
      "description": "Properly handles asynchronous operations using async/await or promises for pool.query() and pool.end() methods",
      "max_score": 5
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-pg-native

tile.json