From d7a978642ef60253414cf3b5f5c599a26ebfa373 Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Mon, 10 Jul 2023 19:51:33 +0800 Subject: [PATCH] Do not throw RecordNotUpdated error --- src/executor/update.rs | 6 +----- tests/returning_tests.rs | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/executor/update.rs b/src/executor/update.rs index d2d772ec..aef8b4d5 100644 --- a/src/executor/update.rs +++ b/src/executor/update.rs @@ -153,11 +153,7 @@ impl Updater { ) .all(db) .await?; - // If we got an empty Vec then we are updating a row that does not exist. - match models.is_empty() { - true => Err(DbErr::RecordNotUpdated), - false => Ok(models), - } + Ok(models) } false => unimplemented!("Database backend doesn't support RETURNING"), } diff --git a/tests/returning_tests.rs b/tests/returning_tests.rs index fe0ca458..bcdcc38d 100644 --- a/tests/returning_tests.rs +++ b/tests/returning_tests.rs @@ -1,7 +1,7 @@ pub mod common; pub use common::{bakery_chain::*, setup::*, TestContext}; -pub use sea_orm::{entity::prelude::*, *}; +use sea_orm::{entity::prelude::*, IntoActiveModel}; pub use sea_query::{Expr, Query}; use serde_json::json;