Skip to main content

Module connection

Module connection 

Source
Expand description

PostgreSQL connection backends.

This module provides two interchangeable connection implementations, selected at compile time via feature flags:

  • libpq (default): Uses the C libpq library via FFI. Requires libpq-dev and libssl-dev at build time.

  • rustls-tls: Pure-Rust implementation using rustls with the aws-lc-rs crypto backend for hardware-accelerated TLS (AES-NI, AVX2). Requires cmake + C compiler at build time. When enabled alongside the default libpq feature, rustls-tls takes priority so that features = ["rustls-tls"] works without needing default-features = false.

Both backends expose the same public types: PgReplicationConnection and PgResult.

Structsยง

PgReplicationConnection
Safe wrapper around PostgreSQL connection for replication
PgResult
Safe wrapper for PostgreSQL result