Skip to main content

SqlReflectedTable

Struct SqlReflectedTable 

Source
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

Source

pub fn column(&self, name: &str) -> Option<&SqlColumnSchema>

Look up a column by name. Mirrors SqlTableSchema::column.

Per br-frankenpandas-63ac (fd90.51).

Source

pub fn index(&self, name: &str) -> Option<&SqlIndexSchema>

Look up an index by name.

Per br-frankenpandas-63ac (fd90.51).

Source

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).

Source

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).

Source

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).

Source

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

Source§

fn clone(&self) -> SqlReflectedTable

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SqlReflectedTable

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SqlReflectedTable

Source§

impl PartialEq for SqlReflectedTable

Source§

fn eq(&self, other: &SqlReflectedTable) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SqlReflectedTable

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.