Skip to main content

build_replication_config

Function build_replication_config 

Source
pub fn build_replication_config(config: &PostgresCdcConfig) -> ReplicationConfig
Expand description

Builds a [pgwire_replication::ReplicationConfig] from a PostgresCdcConfig.

Maps connection parameters, replication slot, publication, start LSN, keepalive interval, and TLS settings.

§TLS Mapping

SslModeTlsConfig method
Disabledisabled()
Preferrequire() (no prefer in upstream)
Requirerequire()
VerifyCaverify_ca(ca_path)
VerifyFullverify_full(ca_path)

Optional SNI hostname and mTLS client cert/key are chained as builder steps when their config fields are set.

§Note

pgwire-replication manages slot creation externally — use ensure_replication_slot() before calling this.