pub struct RelationRegistry { /* private fields */ }Implementations§
Source§impl RelationRegistry
impl RelationRegistry
Sourcepub fn register(
&mut self,
from_table: &str,
from_col: &str,
to_table: &str,
to_col: &str,
)
pub fn register( &mut self, from_table: &str, from_col: &str, to_table: &str, to_col: &str, )
Register a relation from schema.
Sourcepub fn get(&self, from_table: &str, to_table: &str) -> Option<(&str, &str)>
pub fn get(&self, from_table: &str, to_table: &str) -> Option<(&str, &str)>
Lookup join columns for a relation. Returns (from_col, to_col) if relation exists.
Sourcepub fn referencing(&self, table: &str) -> Vec<&str>
pub fn referencing(&self, table: &str) -> Vec<&str>
Get all tables that reference this table (for reverse joins).
Sourcepub fn from_build_schema(schema: &Schema) -> Self
pub fn from_build_schema(schema: &Schema) -> Self
Load relations from a parsed build::Schema.
Trait Implementations§
Source§impl Debug for RelationRegistry
impl Debug for RelationRegistry
Source§impl Default for RelationRegistry
impl Default for RelationRegistry
Source§fn default() -> RelationRegistry
fn default() -> RelationRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RelationRegistry
impl RefUnwindSafe for RelationRegistry
impl Send for RelationRegistry
impl Sync for RelationRegistry
impl Unpin for RelationRegistry
impl UnwindSafe for RelationRegistry
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