Struct datamodel_renderer::datamodel::IdFieldDefinition
source · pub struct IdFieldDefinition<'a>(/* private fields */);
Expand description
Defines the id attribute in a field.
Implementations§
source§impl<'a> IdFieldDefinition<'a>
impl<'a> IdFieldDefinition<'a>
sourcepub fn new() -> Self
pub fn new() -> Self
Makes the given field to be the model’s primary key.
ⓘ
field Int @id
// ^^^ here
sourcepub fn map(&mut self, map: impl Into<Cow<'a, str>>)
pub fn map(&mut self, map: impl Into<Cow<'a, str>>)
The primary key constraint name.
ⓘ
field Int @id(map: "Foo")
// ^^^^^ here
sourcepub fn clustered(&mut self, clustered: bool)
pub fn clustered(&mut self, clustered: bool)
The constraint clustering setting.
ⓘ
field Int @id(clustered: false)
// ^^^^^ here
Trait Implementations§
source§impl<'a> Debug for IdFieldDefinition<'a>
impl<'a> Debug for IdFieldDefinition<'a>
source§impl<'a> Default for IdFieldDefinition<'a>
impl<'a> Default for IdFieldDefinition<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for IdFieldDefinition<'a>
impl<'a> Send for IdFieldDefinition<'a>
impl<'a> Sync for IdFieldDefinition<'a>
impl<'a> Unpin for IdFieldDefinition<'a>
impl<'a> UnwindSafe for IdFieldDefinition<'a>
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