pub struct TableInfo { /* private fields */ }Expand description
Table information panel for displaying detailed table structure.
Displays a single table’s complete information in a panel format, including columns, indexes, foreign keys, and optional statistics.
Implementations§
Source§impl TableInfo
impl TableInfo
Sourcepub fn new<S: Into<String>>(name: S, columns: Vec<ColumnData>) -> Self
pub fn new<S: Into<String>>(name: S, columns: Vec<ColumnData>) -> Self
Create a new table info display.
Sourcepub fn with_primary_key(self, columns: Vec<String>) -> Self
pub fn with_primary_key(self, columns: Vec<String>) -> Self
Set the primary key columns.
Sourcepub fn with_indexes(self, indexes: Vec<IndexData>) -> Self
pub fn with_indexes(self, indexes: Vec<IndexData>) -> Self
Set all indexes.
Sourcepub fn add_foreign_key(self, fk: ForeignKeyData) -> Self
pub fn add_foreign_key(self, fk: ForeignKeyData) -> Self
Add a foreign key.
Sourcepub fn with_foreign_keys(self, fks: Vec<ForeignKeyData>) -> Self
pub fn with_foreign_keys(self, fks: Vec<ForeignKeyData>) -> Self
Set all foreign keys.
Sourcepub fn with_stats(self, stats: TableStats) -> Self
pub fn with_stats(self, stats: TableStats) -> Self
Set table statistics.
Sourcepub fn show_types(self, show: bool) -> Self
pub fn show_types(self, show: bool) -> Self
Set whether to show column types.
Sourcepub fn show_constraints(self, show: bool) -> Self
pub fn show_constraints(self, show: bool) -> Self
Set whether to show constraints.
Sourcepub fn render_plain(&self) -> String
pub fn render_plain(&self) -> String
Render as plain text for agent consumption.
Sourcepub fn render_styled(&self) -> String
pub fn render_styled(&self) -> String
Render with ANSI colors for terminal display.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TableInfo
impl RefUnwindSafe for TableInfo
impl Send for TableInfo
impl Sync for TableInfo
impl Unpin for TableInfo
impl UnsafeUnpin for TableInfo
impl UnwindSafe for TableInfo
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