# jtv/libpqxx

The official C++ client API for PostgreSQL.

Repository: https://github.com/jtv/libpqxx
Canonical: https://ross.abutalabs.com/products/libpqxx
Homepage: http://pqxx.org/libpqxx/
Language: C++
License: BSD-3-Clause
License Family: permissive
Topics: postgresql, postgres, cplusplus, cplusplus-17, databases, cplusplus-20, cplusplus-23
Last push: 2026-08-03T09:32:49+00:00

## Health v2 (maintenance only)
Score: 91/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 95, release rhythm 81, longevity 100
- inputs: {"age_days": 3632, "days_push": 30, "days_rel": 46, "gap_med": 48.0, "n_releases_24m": 11}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1349, forks 292 (observed 2026-08-28T04:04:27.928610+00:00)

## What it is
libpqxx is the official C++ client API for PostgreSQL, wrapping the C libpq library in a modern, C++-native interface with transaction and connection classes. It is actively maintained, with the 8.x series requiring C++20 and building via CMake or configure.

## Use cases
- connect to a postgresql database from c++
- run sql queries and transactions in c++
- c++ postgres client library
- bulk data retrieval from postgres in c++
- replace raw libpq calls with a c++-native api

## When to choose
- you are writing C++ software that needs to access PostgreSQL
- you want an idiomatic C++ API with RAII-style transactions over raw libpq
- you need the official, long-maintained PostgreSQL binding for C++

## When to avoid
- you use a different database than PostgreSQL
- your project is stuck on a pre-C++20 compiler and you need the latest 8.x features
- you need an ORM or schema management rather than a client driver

## Facets
- artifact type: library
- maturity: stable
- function: database-driver, database
- domain: databases, developer-tools, backend
- platform: windows, cpp, cross-platform
- tags: postgresql, libpq, sql, transactions, cplusplus, linux, macos

## Member repositories
- jtv/libpqxx (main) score 91

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:27.928610+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:42:22.027750+00:00, confidence not recorded.
  - readme: https://github.com/jtv/libpqxx (fetched 2026-08-28T04:04:27.928610+00:00, sha c7082ab5be32)
  - homepage: http://pqxx.org/libpqxx/ (fetched 2026-08-29T12:01:23.623026+00:00, sha e995372da30a)
  - site_page: https://pqxx.org/libpqxx/faq (fetched 2026-08-29T12:01:23.632615+00:00, sha efffb8de07b5)
- Data as of 2026-08-30T08:39:29.467469+00:00.
