pub struct TableInfo {
pub table_schema: String,
pub table_name: String,
pub columns: Vec<ColumnInfo>,
pub foreign_keys: Vec<ForeignKeyConstraint>,
pub indexes: Vec<IndexInfo>,
pub check_constraints: Vec<CheckConstraint>,
pub comment: Option<String>,
}Expand description
Table information
Fields§
§table_schema: String§table_name: String§columns: Vec<ColumnInfo>§foreign_keys: Vec<ForeignKeyConstraint>§indexes: Vec<IndexInfo>§check_constraints: Vec<CheckConstraint>§comment: Option<String>Implementations§
Source§impl TableInfo
impl TableInfo
Sourcepub fn uses_postgis(&self) -> bool
pub fn uses_postgis(&self) -> bool
Check if table uses PostGIS extension
Sourcepub fn get_postgis_types(&self) -> HashMap<String, i32>
pub fn get_postgis_types(&self) -> HashMap<String, i32>
Get details of columns using PostGIS types
Sourcepub fn to_index_ddl(&self) -> Vec<String>
pub fn to_index_ddl(&self) -> Vec<String>
Generate DDL for index creation
Sourcepub fn to_comment_ddl(&self) -> Vec<String>
pub fn to_comment_ddl(&self) -> Vec<String>
Generate DDL for table and column comments
Sourcepub fn get_referenced_tables(&self) -> Vec<String>
pub fn get_referenced_tables(&self) -> Vec<String>
Get list of referenced tables
Sourcepub fn has_foreign_keys(&self) -> bool
pub fn has_foreign_keys(&self) -> bool
Check if table has foreign keys
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TableInfo
impl<'de> Deserialize<'de> for TableInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for TableInfo
Auto Trait Implementations§
impl Freeze for TableInfo
impl RefUnwindSafe for TableInfo
impl Send for TableInfo
impl Sync for TableInfo
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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