pub struct TableDef {
pub name: &'static str,
pub primary_key: &'static [&'static str],
pub values: Values,
pub key_values: Values,
pub other_values: Values,
pub constraints: &'static [Constraint],
}Expand description
Definition of a Table used to generate the SQL schema
Created by the #[derive(Table)] proc-macro.
Fields§
§name: &'static strName of the table: #[derive(Table)] uses the lowercase name of the struct
primary_key: &'static [&'static str]Names of the Columns that make up the values of the primary #[key]
This is empty if the Table has no primary key.
values: ValuesDefinitions and names for all constituent Values
key_values: ValuesDefinitions and names for all (if any) primary key Values
other_values: ValuesDefinitions and names for all Values that are not (part of) the primary key.
This could be empty (if all [Value']s are part of the primary key), or it could be equal to values`.
constraints: &'static [Constraint]List of Table-level Constraints
Implementations§
Trait Implementations§
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