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 insert<'a, 'async_trait, C>(
self,
db: &'a C
) -> Pin<Box<dyn Future<Output = Result<<Self::Entity as EntityTrait>::Model, DbErr>> + Send + 'async_trait, Global>> where
'a: 'async_trait,
Self: 'a + ActiveModelBehavior + 'async_trait + Send,
C: ConnectionTrait + 'async_trait,
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
fn insert<'a, 'async_trait, C>(
self,
db: &'a C
) -> Pin<Box<dyn Future<Output = Result<<Self::Entity as EntityTrait>::Model, DbErr>> + Send + 'async_trait, Global>> where
'a: 'async_trait,
Self: 'a + ActiveModelBehavior + 'async_trait + Send,
C: ConnectionTrait + 'async_trait,
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
Perform an INSERT
operation on the ActiveModel Read more
sourcefn update<'a, 'async_trait, C>(
self,
db: &'a C
) -> Pin<Box<dyn Future<Output = Result<<Self::Entity as EntityTrait>::Model, DbErr>> + Send + 'async_trait, Global>> where
'a: 'async_trait,
Self: 'a + ActiveModelBehavior + 'async_trait + Send,
C: ConnectionTrait + 'async_trait,
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
fn update<'a, 'async_trait, C>(
self,
db: &'a C
) -> Pin<Box<dyn Future<Output = Result<<Self::Entity as EntityTrait>::Model, DbErr>> + Send + 'async_trait, Global>> where
'a: 'async_trait,
Self: 'a + ActiveModelBehavior + 'async_trait + Send,
C: ConnectionTrait + 'async_trait,
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
Perform the UPDATE
operation on an ActiveModel Read more
sourcefn save<'a, 'async_trait, C>(
self,
db: &'a C
) -> Pin<Box<dyn Future<Output = Result<Self, DbErr>> + Send + 'async_trait, Global>> where
'a: 'async_trait,
Self: 'a + ActiveModelBehavior + 'async_trait + Send,
C: ConnectionTrait + 'async_trait,
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
fn save<'a, 'async_trait, C>(
self,
db: &'a C
) -> Pin<Box<dyn Future<Output = Result<Self, DbErr>> + Send + 'async_trait, Global>> where
'a: 'async_trait,
Self: 'a + ActiveModelBehavior + 'async_trait + Send,
C: ConnectionTrait + 'async_trait,
<Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
Insert the model if primary key is NotSet
, update otherwise.
Only works if the entity has auto increment primary key. Read more
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
Returns true
if any columns were changed.
sourceimpl 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 more
sourceimpl 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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ActiveModel) -> bool
fn ne(&self, other: &ActiveModel) -> bool
This method tests for !=
.
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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 A where
A: ActiveModelTrait,
impl<A> IntoActiveModel<A> for A where
A: ActiveModelTrait,
sourcefn into_active_model(self) -> A
fn into_active_model(self) -> A
Method to call to perform the conversion
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more