# theory/pgtap

PostgreSQL Unit Testing Suite

Repository: https://github.com/theory/pgtap
Canonical: https://ross.abutalabs.com/products/pgtap
Homepage: https://pgtap.org
Language: PLpgSQL
License Family: other
Topics: pgtap, pgsql, psql, tap, testing, testing-framework, testing-library, unit-testing
Last push: 2026-08-23T21:43:29+00:00

## Health v2 (maintenance only)
Score: 71/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 18, longevity 100
- inputs: {"age_days": 6365, "days_push": 10, "days_rel": 333, "gap_med": null, "n_releases_24m": 1}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1161, forks 108 (observed 2026-08-28T04:03:49.429480+00:00)

## What it is
pgTAP is a unit testing framework for PostgreSQL written in PL/pgSQL and PL/SQL. It provides a comprehensive set of TAP-emitting assertion functions for testing schemas, functions, triggers, and query results, and integrates with TAP harnesses or xUnit-style testing.

## Use cases
- unit test postgresql database functions
- verify database schema structure in tests
- test triggers and views in postgres
- run TAP-emitting database tests with a harness
- write xUnit-style tests inside postgres
- assert query results match expected sets

## When to choose
- you develop PostgreSQL-backed applications and want to test the database itself
- you want TAP output compatible with existing test harnesses
- you need assertions for schema objects, functions, triggers, and result sets

## When to avoid
- you use a database other than PostgreSQL
- you cannot install extensions on the database server host
- you only need application-level tests that happen to touch the database

## Facets
- artifact type: library
- maturity: active
- function: testing
- domain: databases, testing, developer-tools
- platform: windows, cli
- tags: postgresql, tap, unit-testing, plpgsql, database-testing, xunit, linux, macos

## Member repositories
- theory/pgtap (main) score 71

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:49.429480+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-30T06:31:45.041636+00:00, confidence not recorded.
  - readme: https://github.com/theory/pgtap (fetched 2026-08-28T04:03:49.429480+00:00, sha b166de304aeb)
  - homepage: https://pgtap.org (fetched 2026-08-29T12:36:13.332839+00:00, sha 4b8f48b581dd)
  - site_page: https://pgtap.org/documentation.html (fetched 2026-08-29T12:36:13.342367+00:00, sha 3a725d278fd3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
