Skip to main content

Module postgres

Module postgres 

Source
Expand description

PostgreSQL logical replication CDC source connector. PostgreSQL CDC source connector.

Streams row-level changes from PostgreSQL using logical replication (pgoutput plugin). Supports INSERT, UPDATE, DELETE operations with Z-set changelog integration.

§Architecture

Ring 0 (Hot Path):  SPSC pop only (~5ns, zero CDC code)
Ring 1 (Background): WAL consumption → pgoutput decode → Arrow conversion
Ring 2 (Control):    Slot management, schema discovery, health checks

§Module Structure

  • config - Connection and replication configuration
  • lsn - Log Sequence Number type
  • types - PostgreSQL OID to Arrow type mapping
  • decoder - pgoutput binary protocol parser
  • schema - Relation (table) schema cache
  • changelog - Z-set change event conversion
  • metrics - Lock-free atomic CDC metrics
  • source - PostgresCdcSource implementing SourceConnector

§Usage

use laminar_connectors::cdc::postgres::{PostgresCdcSource, PostgresCdcConfig};

let config = PostgresCdcConfig::new("localhost", "mydb", "laminar_slot", "laminar_pub");
let mut source = PostgresCdcSource::new(config);

Re-exports§

pub use config::PostgresCdcConfig;
pub use config::SnapshotMode;
pub use config::SslMode;
pub use lsn::Lsn;
pub use source::PostgresCdcSource;

Modules§

changelog
Z-set changelog integration for PostgreSQL CDC events.
config
PostgreSQL CDC source connector configuration.
decoder
PostgreSQL pgoutput logical replication protocol decoder.
lsn
PostgreSQL Log Sequence Number (LSN) type.
metrics
PostgreSQL CDC source connector metrics.
postgres_io
PostgreSQL logical replication I/O functions.
schema
PostgreSQL relation schema cache.
source
PostgreSQL CDC source connector implementation.
types
PostgreSQL type OID to Arrow DataType mapping.

Functions§

register_postgres_cdc
Registers the PostgreSQL CDC source connector with the given registry.