pub struct Junction {
pub table: QualifiedIdentifier,
pub constraint1: CompactString,
pub constraint2: CompactString,
pub cols_source: SmallVec<[(CompactString, CompactString); 2]>,
pub cols_target: SmallVec<[(CompactString, CompactString); 2]>,
}Expand description
Junction table for many-to-many relationships
Represents the intermediate table that connects two tables in an M2M relationship.
Fields§
§table: QualifiedIdentifierThe junction table
constraint1: CompactStringFK constraint from junction to source table
constraint2: CompactStringFK constraint from junction to target table
cols_source: SmallVec<[(CompactString, CompactString); 2]>Column mappings from junction to source: (junction_col, source_col)
cols_target: SmallVec<[(CompactString, CompactString); 2]>Column mappings from junction to target: (junction_col, target_col)
Implementations§
Source§impl Junction
impl Junction
Sourcepub fn junction_columns(&self) -> impl Iterator<Item = &str>
pub fn junction_columns(&self) -> impl Iterator<Item = &str>
Get all junction table columns used in the relationship
Sourcepub fn source_columns(&self) -> impl Iterator<Item = &str>
pub fn source_columns(&self) -> impl Iterator<Item = &str>
Get the source table column names
Sourcepub fn target_columns(&self) -> impl Iterator<Item = &str>
pub fn target_columns(&self) -> impl Iterator<Item = &str>
Get the target table column names
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Junction
impl RefUnwindSafe for Junction
impl Send for Junction
impl Sync for Junction
impl Unpin for Junction
impl UnsafeUnpin for Junction
impl UnwindSafe for Junction
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