pqi-native
Native (pure-Haskell) adapter for pqi
pqi-native
Status: Alpha. This is a young, LLM-generated reimplementation of
libpq's wire protocol handling. It is verified against a conformance suite (see below), but it hasn't seen much production use yet. See Making libpq a choice for why this project exists and what tradeoffs that implies.
A pure-Haskell pqi adapter
that speaks the PostgreSQL frontend/backend wire protocol directly — no
dependency on the C libpq library.
pqi-native is an LLM-generated port of the PostgreSQL C client library, libpq. The upstream libpq source is the direct reference for the implementation.
Fidelity goal
The goal is byte-identical output to libpq for every protocol-derived
value — error message strings, notice text, result status, field metadata,
cell data, and all structured error fields. Fidelity is continuously enforced
by pqi-conformance, which
runs every operation on both this adapter and a direct
postgresql-libpq
reference connection against the same database and asserts exact equality.
Status
Alpha. The full Pqi.Connection capability record is implemented and
verified against the postgresql-libpq reference via the conformance
differential suite, but the library hasn't yet accumulated real-world
production mileage. Read
Making libpq a choice
for the motivation and the tradeoffs of adopting it at this stage.
Authentication: trust, MD5, and SCRAM-SHA-256 are implemented. SCRAM
is verified against a password-auth PostgreSQL 17 container (which defaults to
scram-sha-256).
- base >=4.11 && <5
- base64-bytestring >=1.2 && <1.3
- bytestring >=0.10 && <0.13
- containers >=0.6 && <0.9
- crypton >=0.34 && <2
- pqi ^>=0.1
- pqi-native:transport
- ptr-peeker ^>=0.2
- ptr-poker ^>=0.1.3
- unix >=2.7 && <2.9
- 0.2.0.1
- 0.2.0.0
- 0.1.0.1
- 0.1.0.0
- 0.0.1.1
- 0.0.1.0