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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//! # rivven-cdc - Change Data Capture for Rivven
//!
//! Production-grade CDC support for PostgreSQL, MySQL, and MariaDB.
//!
//! ## Features
//!
//! - `postgres` - PostgreSQL logical replication via pgoutput
//! - `mysql` - MySQL binlog replication
//! - `mariadb` - MariaDB binlog replication (enables `mysql`)
//! - `full` - All CDC sources
//!
//! ## Architecture
//!
//! ```text
//! ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
//! │ PostgreSQL │ │ MySQL │ │ MariaDB │
//! │ WAL │ │ Binlog │ │ Binlog │
//! └──────┬──────┘ └──────┬──────┘ └──────┬──────┘
//! │ │ │
//! ▼ ▼ ▼
//! ┌──────────────────────────────────────────────────────┐
//! │ CdcSource Trait │
//! └──────────────────────────────────────────────────────┘
//! │ │ │
//! ▼ ▼ ▼
//! ┌──────────────────────────────────────────────────────┐
//! │ CdcEvent │
//! │ { op: Insert/Update/Delete, before, after, ... } │
//! └──────────────────────────────────────────────────────┘
//! ```
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! # #[cfg(feature = "postgres")]
//! # async fn example() -> anyhow::Result<()> {
//! use rivven_cdc::postgres::{PostgresCdc, PostgresCdcConfig};
//! use rivven_cdc::CdcSource;
//!
//! let config = PostgresCdcConfig::builder()
//! .connection_string("postgres://user:pass@localhost/mydb")
//! .slot_name("rivven_slot")
//! .publication_name("rivven_pub")
//! .build()?;
//!
//! let mut cdc = PostgresCdc::new(config);
//! cdc.start().await?;
//! # Ok(())
//! # }
//! ```
// Common module - always available
// Re-export common types at crate root
pub use ;
// PostgreSQL CDC - feature-gated
// MySQL/MariaDB CDC - feature-gated