pub enum ModelAttribute {
Map(String),
Id(Vec<Ident>),
Unique(Vec<Ident>),
Index {
fields: Vec<Ident>,
index_type: Option<Ident>,
name: Option<String>,
map: Option<String>,
},
Check {
expr: BoolExpr,
span: Span,
},
}Expand description
A model-level attribute (@@map, @@id, etc.).
Variants§
Map(String)
@@map(“table_name”) attribute.
Id(Vec<Ident>)
@@id([field1, field2]) composite primary key.
Unique(Vec<Ident>)
@@unique([field1, field2]) composite unique constraint.
Index
@@index([field1, field2], type: Hash, name: “idx_name”, map: “db_idx”) index.
Fields
Check
@@check(bool_expr) — table-level CHECK constraint.
Trait Implementations§
Source§impl Clone for ModelAttribute
impl Clone for ModelAttribute
Source§fn clone(&self) -> ModelAttribute
fn clone(&self) -> ModelAttribute
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelAttribute
impl Debug for ModelAttribute
Source§impl PartialEq for ModelAttribute
impl PartialEq for ModelAttribute
impl StructuralPartialEq for ModelAttribute
Auto Trait Implementations§
impl Freeze for ModelAttribute
impl RefUnwindSafe for ModelAttribute
impl Send for ModelAttribute
impl Sync for ModelAttribute
impl Unpin for ModelAttribute
impl UnsafeUnpin for ModelAttribute
impl UnwindSafe for ModelAttribute
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