Skip to main content

sqlite_diff_rs/
lib.rs

1#![doc = include_str!("../README.md")]
2#![no_std]
3#![deny(clippy::mod_module_files)]
4#![allow(private_bounds, private_interfaces)]
5
6extern crate alloc;
7
8pub mod builders;
9#[cfg(feature = "debezium")]
10pub mod debezium;
11#[cfg(any(test, feature = "testing"))]
12pub mod differential_testing;
13pub(crate) mod encoding;
14pub mod errors;
15#[cfg(feature = "maxwell")]
16pub mod maxwell;
17pub mod parser;
18#[cfg(feature = "pg-walstream")]
19pub mod pg_walstream;
20pub mod schema;
21#[cfg(any(test, feature = "testing"))]
22pub mod testing;
23#[cfg(feature = "wal2json")]
24pub mod wal2json;
25
26// Re-export main types
27pub use builders::{
28    ChangeDelete, ChangeSet, ChangesetFormat, ChangesetOp, ChangesetUpdatePair, ColumnNames,
29    DiffOps, DiffSet, DiffSetBuilder, Indirect, Insert, PatchDelete, PatchSet, PatchsetFormat,
30    PatchsetOp, PatchsetUpdateEntry, Reverse, Update,
31};
32pub use encoding::Value;
33pub use parser::{FormatMarker, ParseError, ParsedDiffSet, TableSchema};
34pub(crate) use schema::IndexableValues;
35pub use schema::{DynTable, NamedColumns, SchemaWithPK, SimpleTable};
36
37// Type aliases for common use cases
38/// Type alias for `Update<T, ChangesetFormat, S, B>`.
39///
40/// Changeset updates store both old and new values for each column.
41pub type ChangeUpdate<T, S, B> = Update<T, ChangesetFormat, S, B>;
42
43/// Type alias for `Update<T, PatchsetFormat, S, B>`.
44///
45/// Patchset updates only store new values (PK values in new, non-PK as Undefined or new value).
46pub type PatchUpdate<T, S, B> = Update<T, PatchsetFormat, S, B>;
47
48// Re-export errors
49pub use errors::Error;