diff --git a/01.workspace/heave/examples/simple_product.rs b/01.workspace/heave/examples/simple_product.rs index 58f3195..0a08169 100644 --- a/01.workspace/heave/examples/simple_product.rs +++ b/01.workspace/heave/examples/simple_product.rs @@ -1,4 +1,5 @@ -use heave::*; +use heave::catalog::*; +use heave::eav::*; // Define a struct named `Product` to represent a product. #[derive(PartialEq, Clone)] diff --git a/01.workspace/heave/examples/using_filters.rs b/01.workspace/heave/examples/using_filters.rs index 2609586..67dea9f 100644 --- a/01.workspace/heave/examples/using_filters.rs +++ b/01.workspace/heave/examples/using_filters.rs @@ -1,4 +1,6 @@ -use heave::*; +use heave::catalog::*; +use heave::eav::*; +use heave::filter::*; // Define a struct named `Component` to represent an electronic component. #[derive(Debug, Clone, PartialEq)] diff --git a/01.workspace/heave/examples/working_with_many_types.rs b/01.workspace/heave/examples/working_with_many_types.rs index c4d0a53..3541f76 100644 --- a/01.workspace/heave/examples/working_with_many_types.rs +++ b/01.workspace/heave/examples/working_with_many_types.rs @@ -1,3 +1,6 @@ +use heave::catalog::*; +use heave::eav::*; +use heave::filter::*; use heave::*; use std::path::Path; diff --git a/01.workspace/heave/src/lib.rs b/01.workspace/heave/src/lib.rs index 0603ae3..2ad39bc 100644 --- a/01.workspace/heave/src/lib.rs +++ b/01.workspace/heave/src/lib.rs @@ -187,22 +187,42 @@ mod tst; pub use crate::str::failed_to::FailedTo; -pub(crate) use crate::str::attribute::O as Attribute; -pub(crate) use crate::str::value::Value; +/// The `catalog` module provides the `Catalog` struct, which serves as the main entry point +/// for interacting with the EAV database. It manages the connection to the SQLite file +/// and maintains an in-memory cache of entities. +pub mod catalog { + pub use crate::str::catalog::O as Catalog; +} -pub use crate::str::entity::O as Entity; -pub use crate::str::entity_state::EntityState; -pub use crate::trt::eav::T as EAV; +/// The `eav` module defines the core components of the Entity-Attribute-Value (EAV) model. +/// It includes the `EAV` trait, which custom structs must implement to be stored as entities, +/// as well as the `Entity` struct for generic entity representation, `Attribute` for entity properties, +/// `Value` for attribute values, and `EntityState` for tracking entity changes. +pub mod eav { + pub(crate) use crate::str::attribute::O as Attribute; + pub use crate::str::entity::O as Entity; + pub use crate::str::entity_state::EntityState; + pub(crate) use crate::str::value::Value; + pub use crate::trt::eav::T as EAV; +} -pub use crate::str::comparison::E as Comparison; -pub use crate::str::condition::E as Condition; -pub use crate::str::filter::O as Filter; - -pub use crate::str::catalog::O as Catalog; +/// The `filter` module provides tools for constructing complex queries to retrieve entities +/// from the database. It includes the `Filter` struct for building query conditions, +/// `Condition` for defining individual filtering criteria, and `Comparison` for specifying +/// how values should be compared. +pub mod filter { + pub use crate::str::comparison::E as Comparison; + pub use crate::str::condition::E as Condition; + pub use crate::str::filter::O as Filter; +} #[cfg(test)] pub(crate) use crate::str::item::O as Item; +use catalog::*; +use eav::*; +use filter::*; + mod sqlite { pub use crate::str::sqlite_failed_to::FailedTo; pub mod build {