Trait sea_orm::entity::ActiveModelTrait[][src]

pub trait ActiveModelTrait: Clone + Debug {
    type Entity: EntityTrait;
    fn take(
        &mut self,
        c: <Self::Entity as EntityTrait>::Column
    ) -> ActiveValue<Value>;
fn get(
        &self,
        c: <Self::Entity as EntityTrait>::Column
    ) -> ActiveValue<Value>;
fn set(&mut self, c: <Self::Entity as EntityTrait>::Column, v: Value);
fn unset(&mut self, c: <Self::Entity as EntityTrait>::Column);
fn is_unset(&self, c: <Self::Entity as EntityTrait>::Column) -> bool;
fn default() -> Self; fn insert<'life0, 'async_trait>(
        self,
        db: &'life0 DatabaseConnection
    ) -> Pin<Box<dyn Future<Output = Result<Self, DbErr>> + Send + 'async_trait>>
    where
        <Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
        'life0: 'async_trait,
        Self: Send + 'async_trait
, { ... }
fn update<'life0, 'async_trait>(
        self,
        db: &'life0 DatabaseConnection
    ) -> Pin<Box<dyn Future<Output = Result<Self, DbErr>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: Send + 'async_trait
, { ... }
fn save<'life0, 'async_trait>(
        self,
        db: &'life0 DatabaseConnection
    ) -> Pin<Box<dyn Future<Output = Result<Self, DbErr>> + Send + 'async_trait>>
    where
        Self: ActiveModelBehavior,
        <Self::Entity as EntityTrait>::Model: IntoActiveModel<Self>,
        'life0: 'async_trait,
        Self: Send + 'async_trait
, { ... }
fn delete<'life0, 'async_trait>(
        self,
        db: &'life0 DatabaseConnection
    ) -> Pin<Box<dyn Future<Output = Result<DeleteResult, DbErr>> + Send + 'async_trait>>
    where
        Self: ActiveModelBehavior,
        'life0: 'async_trait,
        Self: Send + 'async_trait
, { ... } }

Associated Types

Required methods

Provided methods

Insert the model if primary key is unset, update otherwise. Only works if the entity has auto increment primary key.

Delete an active model by its primary key

Implementors