pub struct RelationConfig {
pub field_name: String,
pub target_table: String,
pub local_key: String,
pub foreign_key: String,
pub target_columns: Vec<String>,
pub is_many: bool,
pub nested: Vec<RelationConfig>,
}Expand description
Configuration for a single relation to be loaded.
Fields§
§field_name: StringThe field name in the result struct (e.g. “posts”).
target_table: StringThe target table to join against.
local_key: StringThe column on the source table (e.g., “id”).
foreign_key: StringThe column on the target table (e.g., “author_id”).
target_columns: Vec<String>The columns to select from the target table.
is_many: booltrue for has-many, false for has-one / belongs-to.
nested: Vec<RelationConfig>Nested relations on the target table (reserved).
Trait Implementations§
Source§impl Clone for RelationConfig
impl Clone for RelationConfig
Source§fn clone(&self) -> RelationConfig
fn clone(&self) -> RelationConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RelationConfig
impl RefUnwindSafe for RelationConfig
impl Send for RelationConfig
impl Sync for RelationConfig
impl Unpin for RelationConfig
impl UnsafeUnpin for RelationConfig
impl UnwindSafe for RelationConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more