pub struct TableDef {
pub table: TableName,
pub columns: Vec<ColumnDef>,
}
Fields§
§table: TableName
§columns: Vec<ColumnDef>
Implementations§
Source§impl TableDef
impl TableDef
pub fn derive_insert(&self) -> Insert
Sourcepub fn find_column(&self, column: &ColumnName) -> Option<&ColumnDef>
pub fn find_column(&self, column: &ColumnName) -> Option<&ColumnDef>
find the column def for this column name matching their name
Sourcepub fn get_primary_columns(&self) -> Vec<&ColumnDef>
pub fn get_primary_columns(&self) -> Vec<&ColumnDef>
get the primary columns of this table
Source§impl TableDef
impl TableDef
pub fn into_sql_statement( &self, table_lookup: Option<&TableLookup>, ) -> Result<Statement, Error>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TableDef
impl<'de> Deserialize<'de> for TableDef
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TableDef, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TableDef, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for TableDef
impl Serialize for TableDef
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for TableDef
Auto Trait Implementations§
impl Freeze for TableDef
impl RefUnwindSafe for TableDef
impl Send for TableDef
impl Sync for TableDef
impl Unpin for TableDef
impl UnwindSafe for TableDef
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> 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