1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//! Association proxies for Reinhardt
//!
//! This crate provides SQLAlchemy-style association proxies for simplifying
//! access to related objects through associations.
//!
//! # Features
//!
//! ## Relationship Types
//!
//! - **ForeignKey**: One-to-many and many-to-one relationships
//! - **OneToOne**: Unique one-to-one relationships
//! - **OneToMany**: Reverse side of ForeignKey relationships
//! - **ManyToMany**: Many-to-many relationships through junction tables
//! - **PolymorphicAssociation**: Polymorphic one-to-many relationships
//! - **PolymorphicManyToMany**: Polymorphic many-to-many relationships
//!
//! ## Automatic Reverse Relationship Accessors
//!
//! All relationship types support automatic generation of reverse accessor names
//! when `related_name` is not explicitly provided:
//!
//! ```
//! use reinhardt_db::associations::{ForeignKey, ReverseRelationship};
//!
//! #[derive(Clone)]
//! struct User {
//! id: i64,
//! }
//!
//! let fk: ForeignKey<User, i64> = ForeignKey::new("author_id");
//! // Automatically generates "post_set" as the reverse accessor
//! assert_eq!(fk.get_or_generate_reverse_name("Post"), "post_set");
//! ```
//!
//! ## Polymorphic Associations
//!
//! Support for polymorphic associations allows a model to belong to multiple
//! different model types through a single association:
//!
//! ```
//! use reinhardt_db::associations::PolymorphicAssociation;
//!
//! #[derive(Clone)]
//! struct Comment {
//! id: i64,
//! commentable_id: i64,
//! commentable_type: String,
//! }
//!
//! // A comment can belong to either a Post or a Video
//! let rel: PolymorphicAssociation<i64> = PolymorphicAssociation::new("commentable");
//! ```
//!
//! ## Loading Strategies
//!
//! Multiple loading strategies are available to optimize database queries:
//!
//! - **Lazy**: Load related objects only when accessed
//! - **Eager**: Load related objects immediately with the parent
//! - **SelectIn**: Use SELECT IN strategy for multiple objects
//! - **Joined**: Use SQL JOIN for single query loading
//! - **Subquery**: Use subquery for complex filtering
pub use AssociationCollection;
pub use ;
pub use ;
pub use ManyToMany;
pub use ManyToManyManager;
pub use ;
pub use OneToMany;
pub use OneToOne;
pub use ;
pub use AssociationProxy;
pub use ;
/// Re-export commonly used types