1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//! # pgwire-replication
//!
//! A Tokio-based PostgreSQL logical replication client implementing the pgoutput protocol.
//!
//! ## Features
//!
//! - **Async/await** - Built on Tokio for high-performance async I/O
//! - **TLS support** - Optional rustls-based encryption with verify modes
//! - **SCRAM-SHA-256** - Secure password authentication
//! - **pgoutput protocol** - Native logical replication decoding
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use pgwire_replication::{ReplicationClient, ReplicationConfig, ReplicationEvent, Lsn};
//! use std::time::Duration;
//!
//! # async fn example() -> anyhow::Result<()> {
//! let config = ReplicationConfig {
//! host: "localhost".into(),
//! port: 5432,
//! user: "postgres".into(),
//! password: "secret".into(),
//! database: "mydb".into(),
//! slot: "my_slot".into(),
//! publication: "my_publication".into(),
//! start_lsn: Lsn::ZERO,
//! ..Default::default()
//! };
//!
//! let mut client = ReplicationClient::connect(config).await?;
//!
//! while let Some(ev) = client.recv().await? {
//! match ev {
//! ReplicationEvent::XLogData { wal_end, data, .. } => {
//! println!("Got data at {}: {} bytes", wal_end, data.len());
//! }
//! ReplicationEvent::KeepAlive { wal_end, .. } => {
//! println!("Keepalive at {}", wal_end);
//! }
//! ReplicationEvent::Message { prefix, content, .. } => println!(
//! "Logical message: prefix={}, {} bytes", prefix, content.len()
//! ),
//! ReplicationEvent::StoppedAt {reached: _} => break,
//! ReplicationEvent::Begin { .. } => println!(
//! "Transaction start, probably want to flush in-flight events to the sinks."
//! ),
//! ReplicationEvent::Commit { .. } => println!(
//! "Transanction finished, good time to store a checkpoint at the higher level."
//! ),
//! }
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ## Feature Flags
//!
//! - `tls-rustls` (default) - TLS support via rustls
//! - `scram` (default) - SCRAM-SHA-256 authentication
//! - `md5` - MD5 authentication (legacy)
pub use ;
pub use ;
pub use ;
pub use Lsn;