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(any(test, feature = "testing"))]
10pub mod differential_testing;
11pub(crate) mod encoding;
12pub mod errors;
13#[cfg(feature = "maxwell")]
14pub mod maxwell;
15pub mod parser;
16#[cfg(feature = "pg-walstream")]
17pub mod pg_walstream;
18#[cfg(feature = "pg-walstream")]
19pub mod pg_walstream_reverse;
20pub mod schema;
21#[cfg(any(test, feature = "testing"))]
22pub mod testing;
23#[cfg(feature = "wal2json")]
24pub mod wal2json;
25pub mod wire;
26
27// Re-export main types
28#[cfg(feature = "diesel-async")]
29pub use builders::ApplyOpsAsync;
30#[cfg(feature = "diesel")]
31pub use builders::{
32    Adapter, ApplyOps, Binder, BoundChangesetOp, BoundOp, BoundPatchsetOp, DefaultBinder,
33};
34pub use builders::{
35    ChangeDelete, ChangeSet, ChangesetFormat, ChangesetOp, ChangesetUpdatePair,
36    ChangesetUpdatePairExt, ColumnNames, DiffFormat, DiffOps, DiffSet, DiffSetBuilder, Indirect,
37    Insert, PatchDelete, PatchSet, PatchsetFormat, PatchsetOp, PatchsetUpdateEntry, Reverse,
38    Update,
39};
40pub use encoding::Value;
41pub use parser::{FormatMarker, ParseError, ParsedDiffSet, TableSchema};
42pub use schema::{DynTable, IndexableValues, NamedColumns, SchemaWithPK, SimpleTable};
43pub use wire::{
44    BoolDecoder, DateVerbatimDecoder, DecimalTextDecoder, DecodeError, Decoder, Digestable,
45    Int64OverflowToTextDecoder, IntDecoder, IntervalVerbatimDecoder, JsonCanonicalDecoder,
46    JsonVerbatimDecoder, MySqlBinaryDecoder, NullDecoder, PgBinary, PgBinaryColumn,
47    PgByteaBinaryDecoder, PgByteaTextModeDecoder, RealDecoder, TextDecoder, TimeVerbatimDecoder,
48    TimestampTzVerbatimDecoder, TimestampVerbatimDecoder, TypeMap, TypeMapDefaults,
49    UuidBlob16Decoder, UuidText36Decoder, WireAdapter, WireColumnTypes, WireSchema, WireSource,
50    WireType,
51};
52
53// Type aliases for common use cases
54/// Type alias for `Update<T, ChangesetFormat, S, B>`.
55///
56/// Changeset updates store both old and new values for each column.
57pub type ChangeUpdate<T, S, B> = Update<T, ChangesetFormat, S, B>;
58
59/// Type alias for `Update<T, PatchsetFormat, S, B>`.
60///
61/// Patchset updates only store new values (PK values in new, non-PK as Undefined or new value).
62pub type PatchUpdate<T, S, B> = Update<T, PatchsetFormat, S, B>;
63
64// Re-export errors
65pub use errors::Error;