pub struct GraphView {
pub tables: AHashMap<String, TableInfo>,
pub edges: Vec<EdgeInfo>,
}Expand description
A filtered view of a schema graph for ERD visualization
Fields§
§tables: AHashMap<String, TableInfo>Tables included in this view with full column info
edges: Vec<EdgeInfo>Edges between tables (FK relationships)
Implementations§
Source§impl GraphView
impl GraphView
Sourcepub fn from_schema_graph(graph: &SchemaGraph) -> Self
pub fn from_schema_graph(graph: &SchemaGraph) -> Self
Create a full view from a schema graph (all tables and edges)
Sourcepub fn filter_tables(&mut self, patterns: &[Pattern])
pub fn filter_tables(&mut self, patterns: &[Pattern])
Filter to include only tables matching the given patterns
Sourcepub fn exclude_tables(&mut self, patterns: &[Pattern])
pub fn exclude_tables(&mut self, patterns: &[Pattern])
Exclude tables matching the given patterns
Sourcepub fn focus_table(
&mut self,
table: &str,
transitive: bool,
reverse: bool,
max_depth: Option<usize>,
)
pub fn focus_table( &mut self, table: &str, transitive: bool, reverse: bool, max_depth: Option<usize>, )
Focus on a specific table and its relationships
Sourcepub fn filter_to_cyclic_tables(&mut self, cyclic_tables: &AHashSet<String>)
pub fn filter_to_cyclic_tables(&mut self, cyclic_tables: &AHashSet<String>)
Keep only tables that are part of cycles
Sourcepub fn table_count(&self) -> usize
pub fn table_count(&self) -> usize
Get the number of tables in the view
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Get the number of edges in the view
Sourcepub fn sorted_tables(&self) -> Vec<&TableInfo>
pub fn sorted_tables(&self) -> Vec<&TableInfo>
Get tables sorted alphabetically
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphView
impl RefUnwindSafe for GraphView
impl Send for GraphView
impl Sync for GraphView
impl Unpin for GraphView
impl UnwindSafe for GraphView
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> 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