Struct sea_orm_migration::seaql_migrations::ActiveModel
source · pub struct ActiveModel {
pub version: ActiveValue<String>,
pub applied_at: ActiveValue<i64>,
}Fields
version: ActiveValue<String>applied_at: ActiveValue<i64>Trait Implementations
sourceimpl ActiveModelBehavior for ActiveModel
impl ActiveModelBehavior for ActiveModel
sourcefn new() -> Self
fn new() -> Self
Create a new ActiveModel with default values. Also used by
Default::default().sourcefn before_save(self, insert: bool) -> Result<Self, DbErr>
fn before_save(self, insert: bool) -> Result<Self, DbErr>
Will be called before saving
sourcefn after_save(
model: <Self::Entity as EntityTrait>::Model,
insert: bool
) -> Result<<Self::Entity as EntityTrait>::Model, DbErr>
fn after_save(
model: <Self::Entity as EntityTrait>::Model,
insert: bool
) -> Result<<Self::Entity as EntityTrait>::Model, DbErr>
Will be called after saving
sourcefn before_delete(self) -> Result<Self, DbErr>
fn before_delete(self) -> Result<Self, DbErr>
Will be called before deleting
sourcefn after_delete(self) -> Result<Self, DbErr>
fn after_delete(self) -> Result<Self, DbErr>
Will be called after deleting
sourceimpl ActiveModelTrait for ActiveModel
impl ActiveModelTrait for ActiveModel
sourcefn take(
&mut self,
c: <Self::Entity as EntityTrait>::Column
) -> ActiveValue<Value>
fn take(
&mut self,
c: <Self::Entity as EntityTrait>::Column
) -> ActiveValue<Value>
Get a mutable ActiveValue from an ActiveModel
sourcefn get(&self, c: <Self::Entity as EntityTrait>::Column) -> ActiveValue<Value>
fn get(&self, c: <Self::Entity as EntityTrait>::Column) -> ActiveValue<Value>
Get a immutable ActiveValue from an ActiveModel
sourcefn set(&mut self, c: <Self::Entity as EntityTrait>::Column, v: Value)
fn set(&mut self, c: <Self::Entity as EntityTrait>::Column, v: Value)
Set the Value into an ActiveModel
sourcefn not_set(&mut self, c: <Self::Entity as EntityTrait>::Column)
fn not_set(&mut self, c: <Self::Entity as EntityTrait>::Column)
Set the state of an ActiveValue to the not set state
sourcefn is_not_set(&self, c: <Self::Entity as EntityTrait>::Column) -> bool
fn is_not_set(&self, c: <Self::Entity as EntityTrait>::Column) -> bool
Check the state of a ActiveValue
sourcefn get_primary_key_value(&self) -> Option<ValueTuple>
fn get_primary_key_value(&self) -> Option<ValueTuple>
Get the primary key of the ActiveModel
sourcefn delete<'a, 'async_trait, C>(
self,
db: &'a C
) -> Pin<Box<dyn Future<Output = Result<DeleteResult, DbErr>> + Send + 'async_trait, Global>>where
'a: 'async_trait,
Self: 'a + ActiveModelBehavior + 'async_trait + Send,
C: ConnectionTrait + 'async_trait,
fn delete<'a, 'async_trait, C>(
self,
db: &'a C
) -> Pin<Box<dyn Future<Output = Result<DeleteResult, DbErr>> + Send + 'async_trait, Global>>where
'a: 'async_trait,
Self: 'a + ActiveModelBehavior + 'async_trait + Send,
C: ConnectionTrait + 'async_trait,
Delete an active model by its primary key Read more
sourcefn is_changed(&self) -> bool
fn is_changed(&self) -> bool
Return
true if any attribute of ActiveModel is Setsourceimpl Clone for ActiveModel
impl Clone for ActiveModel
sourcefn clone(&self) -> ActiveModel
fn clone(&self) -> ActiveModel
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for ActiveModel
impl Debug for ActiveModel
sourceimpl Default for ActiveModel
impl Default for ActiveModel
sourceimpl From<<Entity as EntityTrait>::Model> for ActiveModel
impl From<<Entity as EntityTrait>::Model> for ActiveModel
sourcefn from(m: <Entity as EntityTrait>::Model) -> Self
fn from(m: <Entity as EntityTrait>::Model) -> Self
Converts to this type from the input type.
sourceimpl IntoActiveModel<ActiveModel> for <Entity as EntityTrait>::Model
impl IntoActiveModel<ActiveModel> for <Entity as EntityTrait>::Model
sourcefn into_active_model(self) -> ActiveModel
fn into_active_model(self) -> ActiveModel
Method to call to perform the conversion
sourceimpl PartialEq<ActiveModel> for ActiveModel
impl PartialEq<ActiveModel> for ActiveModel
sourcefn eq(&self, other: &ActiveModel) -> bool
fn eq(&self, other: &ActiveModel) -> bool
sourceimpl TryFrom<ActiveModel> for <Entity as EntityTrait>::Model
impl TryFrom<ActiveModel> for <Entity as EntityTrait>::Model
sourceimpl TryIntoModel<<Entity as EntityTrait>::Model> for ActiveModel
impl TryIntoModel<<Entity as EntityTrait>::Model> for ActiveModel
sourcefn try_into_model(self) -> Result<<Entity as EntityTrait>::Model, DbErr>
fn try_into_model(self) -> Result<<Entity as EntityTrait>::Model, DbErr>
Method to call to perform the conversion
impl StructuralPartialEq for ActiveModel
Auto Trait Implementations
impl RefUnwindSafe for ActiveModel
impl Send for ActiveModel
impl Sync for ActiveModel
impl Unpin for ActiveModel
impl UnwindSafe for ActiveModel
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<A> IntoActiveModel<A> for Awhere
A: ActiveModelTrait,
impl<A> IntoActiveModel<A> for Awhere
A: ActiveModelTrait,
sourcefn into_active_model(self) -> A
fn into_active_model(self) -> A
Method to call to perform the conversion