Function sea_orm::entity::save_active_model[][src]

pub async fn save_active_model<A, E>(
    am: A,
    db: &DatabaseConnection
) -> Result<A, DbErr> where
    A: ActiveModelBehavior + ActiveModelTrait<Entity = E>,
    E::Model: IntoActiveModel<A>,
    E: EntityTrait
Expand description

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