pg-wired
PostgreSQL wire protocol v3 in async Rust, with no dependency on
tokio-postgres. The runtime layer for the resolute
stack, but usable on its own when you want a bare wire client.
What it covers
- Async connection with SCRAM-SHA-256 (and
-PLUSchannel binding when TLS is active) and MD5 fallback. - Extended query protocol: Parse, Bind, Describe, Execute, Sync, Close.
Format-agnostic at the type level: callers supply pre-encoded bytes
with a per-column
FormatCodeof Text or Binary. Resolute drives this in binary. - Per-connection statement cache (pseudo-LRU, 256 entries). Parse once, Bind + Execute on reuse.
- Pipelining with writer coalescing and FIFO response matching so concurrent tasks share one TCP connection efficiently.
- LISTEN/NOTIFY, COPY IN/OUT, query cancellation via
CancelToken, negotiated TLS (rustls) under thetlsfeature.
Minimal example
use WireConn;
async
Most applications will want the typed query surface in
resolute rather than raw byte slices.
Features
| feature | default | enables |
|---|---|---|
tls |
no | rustls-backed TLS negotiation (sslmode=prefer / require) with optional mTLS. |
Architecture
See ARCHITECTURE.md for the internals: the reader/writer task split, message coalescing, FIFO response matching, the statement cache, TLS negotiation, and SCRAM.
License
Dual licensed under Apache 2.0 or MIT. See the workspace root for the broader project.