rustcdc 0.6.2

Embeddable Rust CDC library focused on correctness-first capture primitives
Documentation
[package]
name = "rustcdc"
version = "0.6.2"
edition = "2021"
rust-version = "1.92"
description = "Embeddable Rust CDC library focused on correctness-first capture primitives"
authors      = ["hupe1980"]
license = "MIT OR Apache-2.0"
repository   = "https://github.com/hupe1980/rustcdc"
homepage     = "https://github.com/hupe1980/rustcdc"
documentation = "https://docs.rs/rustcdc"
readme       = "README.md"
keywords     = ["cdc", "change-data-capture"]
categories   = ["database", "asynchronous", "data-structures"]

[workspace]
members = [".", "xtask"]
default-members = ["."]
resolver = "2"

[features]
# Default production profile: PostgreSQL source with TLS. Lean by design — no JIT runtime in the
# default binary. Add --features wasm explicitly if WASM transforms are needed.
default = ["postgres", "tls"]
# Enable PostgreSQL-specific source implementations.
postgres = ["dep:tokio-postgres", "dep:tokio-postgres-rustls", "tls"]
# Enable MySQL-specific source implementations.
mysql = ["dep:mysql_async", "dep:mysql_common", "mysql_async/rustls-tls", "mysql_async/ring", "tls"]
# Enable MariaDB CDC support. Uses the MySQL binlog connector under the hood;
# MariaDB-specific protocol differences (GTID format, system variable names,
# capability flags) are handled transparently by the shared connector code.
mariadb = ["mysql"]
# Enable SQL Server-specific source implementations.
sqlserver = ["dep:tiberius", "tls"]
# Enable TLS-related transport support for source connectors.
tls = ["dep:rustls", "dep:rustls-pemfile", "dep:rustls-native-certs", "dep:tokio-rustls"]
# Enable WASM-based transform execution (wasmtime + wasmparser). Required for
# loading `.wasm` modules as event transforms. Safe to disable when WASM
# transforms are not used to reduce the binary size significantly.
wasm = ["dep:wasmtime", "dep:wasmparser"]
# Enable outbox helpers and transforms.
outbox = []
# Enable encryption-oriented transforms and helpers.
encryption = ["dep:aes-gcm", "dep:base64", "dep:hkdf", "dep:hmac"]
# Enable metrics and instrumentation integrations.
metrics = ["dep:opentelemetry", "dep:opentelemetry_sdk", "dep:opentelemetry-otlp"]
# Enable fault-injection and chaos-testing primitives (FaultInjectingSource, FaultInjectingCheckpoint,
# CrashSimulationValidator, DataLossValidator). Must NOT be enabled in production builds.
test-harnesses = []
# Enable CloudEvents 1.0 structured JSON encoding (no additional dependencies).
cloudevents = []
# Enable Protocol Buffer binary encoding via prost.
protobuf = ["dep:prost"]
# Enable Apache Avro binary encoding via apache-avro.
avro = ["dep:apache-avro"]
# Enable Confluent Schema Registry integration (Avro, JSON Schema wire framing, schema registration/lookup,
# subject naming strategies). Delegates HTTP, caching, and wire format to the `schemreg` crate.
schemreg = ["dep:schemreg", "dep:apache-avro", "dep:bytes", "avro"]

[dependencies]
async-trait = "0.1.89"
ahash = { version = "0.8.11", features = ["serde"] }
futures-util = "0.3.31"
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.145"
sha2 = "0.10.9"
thiserror = "2.0.17"
tokio = { version = "1.48.0", features = ["macros", "rt", "signal", "sync", "time", "fs", "io-util"] }
tracing = "0.1.41"
regex = "1.11.1"
wasmparser = { version = "0.246", optional = true }
wasmtime = { version = "44", optional = true }
aes-gcm = { version = "0.10.3", optional = true }
base64 = { version = "0.22.1", optional = true }
hkdf = { version = "0.12", optional = true }
hmac = { version = "0.12", optional = true }
opentelemetry = { version = "0.27", features = ["trace", "metrics"], optional = true }
opentelemetry_sdk = { version = "0.27", features = ["trace", "metrics", "rt-tokio"], optional = true }
opentelemetry-otlp = { version = "0.27", features = ["trace", "metrics", "grpc-tonic"], optional = true }
tokio-postgres = { version = "0.7.15", optional = true }
tokio-postgres-rustls = { version = "0.13", optional = true }
zeroize = { version = "1", features = ["alloc"] }
mysql_async = { version = "0.36.2", default-features = false, features = ["minimal", "binlog"], optional = true }
mysql_common = { version = "0.35.5", default-features = false, features = ["binlog"], optional = true }
tiberius = { version = "0.12.3", default-features = false, features = ["tds73", "tokio", "rustls"], optional = true }
tokio-util = { version = "0.7.16", features = ["compat"] }
rustls = { version = "0.23.19", default-features = false, features = ["std", "ring"], optional = true }
rustls-pemfile = { version = "2.0", optional = true }
rustls-native-certs = { version = "0.8", optional = true }
tokio-rustls = { version = "0.26", default-features = false, features = ["ring", "tls12"], optional = true }
prost = { version = "0.13", optional = true }
apache-avro = { version = "0.17", optional = true }
bytes = { version = "1", optional = true }
schemreg = { version = "0.3", default-features = false, features = ["confluent", "json"], optional = true }

[dev-dependencies]
criterion = "0.7.0"
sqlx = { version = "0.8", default-features = false, features = ["runtime-tokio-rustls", "postgres", "mysql", "json"] }
tempfile = "3.23.0"
testcontainers = "0.25"
tokio-test = "0.4.4"
tracing-subscriber = { version = "0.3.20", features = ["fmt", "std", "json"] }
reqwest = { version = "0.12.5", default-features = false, features = ["json", "rustls-tls"] }
wasm-bindgen = "0.2.105"
wat = "1.240.0"

[[bench]]
name = "quality_perf"
harness = false

[[bench]]
name = "cdc_perf"
harness = false
required-features = ["wasm"]

[[test]]
name = "wasm_conformance_contract"
required-features = ["wasm"]

[[test]]
name = "wasm_runtime_integration"
required-features = ["wasm"]

[[test]]
name = "fault_injection_soak_matrix"
required-features = ["test-harnesses"]

[[test]]
name = "crash_simulation_integration"
required-features = ["test-harnesses"]

[[test]]
name = "data_loss_detection"
required-features = ["test-harnesses"]