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, ColumnNames,
36    DiffOps, DiffSet, DiffSetBuilder, Indirect, Insert, PatchDelete, PatchSet, PatchsetFormat,
37    PatchsetOp, PatchsetUpdateEntry, Reverse, Update,
38};
39pub use encoding::Value;
40pub use parser::{FormatMarker, ParseError, ParsedDiffSet, TableSchema};
41pub use schema::{DynTable, IndexableValues, NamedColumns, SchemaWithPK, SimpleTable};
42pub use wire::{
43    BoolDecoder, DateVerbatimDecoder, DecimalTextDecoder, DecodeError, Decoder, Digestable,
44    Int64OverflowToTextDecoder, IntDecoder, IntervalVerbatimDecoder, JsonCanonicalDecoder,
45    JsonVerbatimDecoder, MySqlBinaryDecoder, NullDecoder, PgBinary, PgBinaryColumn,
46    PgByteaBinaryDecoder, PgByteaTextModeDecoder, RealDecoder, TextDecoder, TimeVerbatimDecoder,
47    TimestampTzVerbatimDecoder, TimestampVerbatimDecoder, TypeMap, TypeMapDefaults,
48    UuidBlob16Decoder, UuidText36Decoder, WireAdapter, WireColumnTypes, WireSchema, WireSource,
49    WireType,
50};
51
52// Type aliases for common use cases
53/// Type alias for `Update<T, ChangesetFormat, S, B>`.
54///
55/// Changeset updates store both old and new values for each column.
56pub type ChangeUpdate<T, S, B> = Update<T, ChangesetFormat, S, B>;
57
58/// Type alias for `Update<T, PatchsetFormat, S, B>`.
59///
60/// Patchset updates only store new values (PK values in new, non-PK as Undefined or new value).
61pub type PatchUpdate<T, S, B> = Update<T, PatchsetFormat, S, B>;
62
63// Re-export errors
64pub use errors::Error;