pub struct SqlReflectedTable {
pub table_name: String,
pub columns: Vec<SqlColumnSchema>,
pub primary_key_columns: Vec<String>,
pub indexes: Vec<SqlIndexSchema>,
pub foreign_keys: Vec<SqlForeignKeySchema>,
pub unique_constraints: Vec<SqlUniqueConstraintSchema>,
pub comment: Option<String>,
}Expand description
Bundle of all introspection metadata for a single SQL table.
Per br-frankenpandas-76mw (fd90.40). Returned by
SqlInspector::reflect_table to give callers the full picture of
a table in one call instead of 5 separate trait dispatches.
Mirrors the bundled view that SQLAlchemy.MetaData.reflect_table
builds internally.
Fields§
§table_name: String§columns: Vec<SqlColumnSchema>§primary_key_columns: Vec<String>§indexes: Vec<SqlIndexSchema>§foreign_keys: Vec<SqlForeignKeySchema>§unique_constraints: Vec<SqlUniqueConstraintSchema>§comment: Option<String>Implementations§
Source§impl SqlReflectedTable
impl SqlReflectedTable
Sourcepub fn column(&self, name: &str) -> Option<&SqlColumnSchema>
pub fn column(&self, name: &str) -> Option<&SqlColumnSchema>
Look up a column by name. Mirrors SqlTableSchema::column.
Per br-frankenpandas-63ac (fd90.51).
Sourcepub fn index(&self, name: &str) -> Option<&SqlIndexSchema>
pub fn index(&self, name: &str) -> Option<&SqlIndexSchema>
Look up an index by name.
Per br-frankenpandas-63ac (fd90.51).
Sourcepub fn unique_constraint(
&self,
name: &str,
) -> Option<&SqlUniqueConstraintSchema>
pub fn unique_constraint( &self, name: &str, ) -> Option<&SqlUniqueConstraintSchema>
Look up a unique constraint by name (backend-generated names
like sqlite_autoindex_* count too — match what
list_unique_constraints surfaced).
Per br-frankenpandas-63ac (fd90.51).
Sourcepub fn foreign_keys_for_column(
&self,
column_name: &str,
) -> Vec<&SqlForeignKeySchema>
pub fn foreign_keys_for_column( &self, column_name: &str, ) -> Vec<&SqlForeignKeySchema>
Find every foreign key whose columns slice contains column_name.
A given column may participate in multiple FK constraints (e.g. the same column referenced by separate FKs to different parents — rare but valid SQL). Returns the matching FKs in their declaration order from PRAGMA foreign_key_list.
Per br-frankenpandas-63ac (fd90.51).
Sourcepub fn indexes_for_column(&self, column_name: &str) -> Vec<&SqlIndexSchema>
pub fn indexes_for_column(&self, column_name: &str) -> Vec<&SqlIndexSchema>
Find every index whose columns slice contains column_name.
Matches multi-column indexes where the column appears at any position (first, middle, last) — useful for answering “is this column indexed” rather than the more restrictive “is this column the leading entry of an index” question.
Per br-frankenpandas-37uy (fd90.52).
Sourcepub fn unique_constraints_for_column(
&self,
column_name: &str,
) -> Vec<&SqlUniqueConstraintSchema>
pub fn unique_constraints_for_column( &self, column_name: &str, ) -> Vec<&SqlUniqueConstraintSchema>
Find every UNIQUE constraint whose columns slice contains
column_name.
Same any-position match semantics as indexes_for_column and
foreign_keys_for_column.
Per br-frankenpandas-37uy (fd90.52).
Trait Implementations§
Source§impl Clone for SqlReflectedTable
impl Clone for SqlReflectedTable
Source§fn clone(&self) -> SqlReflectedTable
fn clone(&self) -> SqlReflectedTable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SqlReflectedTable
impl Debug for SqlReflectedTable
impl Eq for SqlReflectedTable
Source§impl PartialEq for SqlReflectedTable
impl PartialEq for SqlReflectedTable
impl StructuralPartialEq for SqlReflectedTable
Auto Trait Implementations§
impl Freeze for SqlReflectedTable
impl RefUnwindSafe for SqlReflectedTable
impl Send for SqlReflectedTable
impl Sync for SqlReflectedTable
impl Unpin for SqlReflectedTable
impl UnsafeUnpin for SqlReflectedTable
impl UnwindSafe for SqlReflectedTable
Blanket Implementations§
impl<T> Allocation for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.