pub mod builder;
pub mod collection;
pub mod joins;
pub mod lazy_url;
pub mod loading;
pub mod orm_integration;
#[allow(clippy::module_inception)]
pub mod proxy;
pub mod query;
pub mod reflection;
pub mod scalar;
pub mod url_namespace;
pub mod url_pattern;
pub mod url_resolver;
pub use builder::{ProxyBuilder, association_proxy};
pub use collection::{CollectionAggregations, CollectionOperations, CollectionProxy};
pub use joins::{
CircularReferenceError, JoinConfig, NestedProxy, RelationshipPath, extract_through_path,
filter_through_path, traverse_and_extract, traverse_relationships,
};
pub use lazy_url::LazyUrl;
pub use loading::{
EagerLoadConfig, EagerLoadable, LazyLoadable, LazyLoaded, LoadStrategy, RelationshipCache,
};
pub use orm_integration::OrmReflectable;
pub use reinhardt_db::orm::LoadingStrategy;
pub use proxy::{AssociationProxy, ProxyAccessor, ProxyTarget, ScalarValue};
pub use query::{FilterCondition, FilterOp, QueryFilter};
pub use reflection::{
AttributeExtractor, ProxyCollection, Reflectable, ReflectableFactory, downcast_relationship,
extract_collection_values,
};
pub use scalar::{ScalarComparison, ScalarProxy};
pub use url_namespace::UrlNamespace;
pub use url_pattern::UrlPattern;
pub use url_resolver::UrlResolver;
use thiserror::Error;
pub type ProxyResult<T> = Result<T, ProxyError>;
#[derive(Debug, Error)]
pub enum ProxyError {
#[error("Target relationship '{0}' not found")]
RelationshipNotFound(String),
#[error("Attribute '{0}' not found on target")]
AttributeNotFound(String),
#[error("Type mismatch: expected {expected}, got {actual}")]
TypeMismatch {
expected: String,
actual: String,
},
#[error("Invalid proxy configuration: {0}")]
InvalidConfiguration(String),
#[error("Database error: {0}")]
DatabaseError(String),
#[error("Serialization error: {0}")]
SerializationError(String),
#[error(
"Factory not configured for collection proxy - required for creating objects from scalar values"
)]
FactoryNotConfigured,
#[error("Version tracking is not enabled for this proxy")]
VersionTrackingNotEnabled,
#[error("Version mismatch: expected {expected}, got {actual}")]
VersionMismatch {
expected: i64,
actual: i64,
},
}