Skip to main content

reifydb_cdc/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2026 ReifyDB
3
4//! Change Data Capture: a durable, ordered, addressable record of every committed write. Producers and
5//! consumers are decoupled, so a consumer may fall arbitrarily far behind and catch up later.
6//!
7//! Invariant: a CDC record reflects exactly the deltas committed under its transaction id, in the order the
8//! engine produced them. Reordering or dropping deltas here desynchronises replicas and subscriptions.
9
10#![cfg_attr(not(debug_assertions), deny(clippy::disallowed_methods))]
11#![cfg_attr(debug_assertions, warn(clippy::disallowed_methods))]
12#![cfg_attr(not(debug_assertions), deny(warnings))]
13#![allow(clippy::tabs_in_doc_comments)]
14
15use reifydb_core::interface::version::{ComponentType, HasVersion, SystemVersion};
16
17#[cfg(all(feature = "sqlite", not(target_arch = "wasm32")))]
18pub mod compact;
19pub mod consume;
20pub mod error;
21pub mod produce;
22pub mod storage;
23pub mod testing;
24
25pub struct CdcVersion;
26
27impl HasVersion for CdcVersion {
28	fn version(&self) -> SystemVersion {
29		SystemVersion {
30			name: env!("CARGO_PKG_NAME")
31				.strip_prefix("reifydb-")
32				.unwrap_or(env!("CARGO_PKG_NAME"))
33				.to_string(),
34			version: env!("CARGO_PKG_VERSION").to_string(),
35			description: "Change Data Capture module".to_string(),
36			r#type: ComponentType::Module,
37		}
38	}
39}