pub struct RelationshipConfig {
pub name: String,
pub from_table: String,
pub to_table: String,
pub from_column: String,
pub to_column: String,
pub relation_type: String,
pub description: Option<String>,
}Expand description
Relationship configuration
Fields§
§name: StringRelationship name (used in GraphQL field)
from_table: StringSource table
to_table: StringTarget table
from_column: StringSource column (foreign key)
to_column: StringTarget column (primary key)
relation_type: StringRelationship type
description: Option<String>Description
Implementations§
Source§impl RelationshipConfig
impl RelationshipConfig
Sourcepub fn new(
name: impl Into<String>,
from_table: impl Into<String>,
to_table: impl Into<String>,
) -> Self
pub fn new( name: impl Into<String>, from_table: impl Into<String>, to_table: impl Into<String>, ) -> Self
Create a new relationship configuration
Sourcepub fn from_column(self, column: impl Into<String>) -> Self
pub fn from_column(self, column: impl Into<String>) -> Self
Set from column
Sourcepub fn relation_type(self, rel_type: impl Into<String>) -> Self
pub fn relation_type(self, rel_type: impl Into<String>) -> Self
Set relation type
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set description
Trait Implementations§
Source§impl Clone for RelationshipConfig
impl Clone for RelationshipConfig
Source§fn clone(&self) -> RelationshipConfig
fn clone(&self) -> RelationshipConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 RelationshipConfig
impl RefUnwindSafe for RelationshipConfig
impl Send for RelationshipConfig
impl Sync for RelationshipConfig
impl Unpin for RelationshipConfig
impl UnsafeUnpin for RelationshipConfig
impl UnwindSafe for RelationshipConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more