vitaly-t/pg-promise

PostgreSQL interface for Node.js

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 51 minutes ago
Type:Library / SDKCategory(s):Relational & SQL DatabasesDatabases & Storage
Added to GitGenius on September 19th, 2026
Created on March 4th, 2015
Open Issues & Pull Requests: 0 (+0)
GitHub issues: Enabled
Number of forks: 220
Total Stargazers: 3,552 (+0)
Total Subscribers: 42 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 0.9 hours
Mean response time: 28.8 hours
90th percentile: 4.5 days
Tracked items: 24

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 0
New in 7 days: 0
Closed in 7 days: 0
Avg open age: N/A days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • invalid usage (4)
  • improvement (3)
  • triage (3)
  • Help Wanted (2)
  • dependency issue (2)
  • invalid / unrelated (2)
  • question (2)
  • won't do (2)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

pg-promise is a PostgreSQL interface for Node.js that wraps the base node-postgres driver with promise-based abstractions and advanced query handling.

The library solves the problem of managing database connections and transactions in Node.js applications by providing automatic connection pooling and transaction handling on top of node-postgres. It adds a powerful query-formatting engine that supports index variables, named parameters, nested parameters, and custom type formatting. The approach emphasizes result-specific methods named according to expected row counts—such as one, many, oneOrNone, and manyOrNone—to protect code from unexpected query results by automatically rejecting mismatches. Tasks and transactions are the core abstractions: tasks provide shared connections for multiple queries, while transactions handle nested transactions with configurable behavior. The library also supports external SQL files, global event reporting for centralized error handling, and streaming for large result sets.

Developers should choose this tool when building Node.js applications that need reliable PostgreSQL access with strong guarantees around result cardinality and transaction safety. It suits projects where query formatting flexibility matters—particularly those using external SQL files or complex parameter binding. The declarative approach to result handling makes it valuable for teams wanting to catch data shape mismatches early rather than discovering them in production. The library is not positioned against alternatives in its documentation, so no comparative guidance is available.

The project maintains comprehensive documentation including an official guide, contribution notes, and a beginner's tutorial with examples. The codebase includes extensive support for customization through events and extensible protocols. The library's scope has grown significantly beyond its original purpose of adding promises to the base driver, now encompassing connection management, transaction control, and sophisticated query generation as core features.