This commit is contained in:
Chris Tsang 2023-07-26 18:43:55 +01:00
parent ebbfc0f5be
commit 8064097639
4 changed files with 6 additions and 7 deletions

View File

@ -149,10 +149,10 @@ assert_eq!(format!("{}", DisplayTea::BreakfastTea), "Breakfast Tea");
``` ```
* Added `UpdateMany::exec_with_returning()` https://github.com/SeaQL/sea-orm/pull/1677 * Added `UpdateMany::exec_with_returning()` https://github.com/SeaQL/sea-orm/pull/1677
```rust ```rust
Entity::update_many() let models: Vec<Model> = Entity::update_many()
.col_expr(Column::Values, Expr::expr(..)) .col_expr(Column::Values, Expr::expr(..))
.exec_with_returning(db) .exec_with_returning(db)
.await .await?;
``` ```
* Supporting `default_expr` in `DeriveEntityModel` https://github.com/SeaQL/sea-orm/pull/1474 * Supporting `default_expr` in `DeriveEntityModel` https://github.com/SeaQL/sea-orm/pull/1474
```rust ```rust

View File

@ -82,7 +82,7 @@ where
} }
} }
/// Execute an insert operation and return the inserted model (use `RETURNING` syntax if database supported) /// Execute an insert operation and return the inserted model (use `RETURNING` syntax if supported)
pub async fn exec_with_returning<'a, C>( pub async fn exec_with_returning<'a, C>(
self, self,
db: &'a C, db: &'a C,
@ -141,7 +141,7 @@ where
Inserter::<A>::new(self.primary_key, self.query).exec_without_returning(db) Inserter::<A>::new(self.primary_key, self.query).exec_without_returning(db)
} }
/// Execute an insert operation and return the inserted model (use `RETURNING` syntax if database supported) /// Execute an insert operation and return the inserted model (use `RETURNING` syntax if supported)
pub fn exec_with_returning<'a, C>( pub fn exec_with_returning<'a, C>(
self, self,
db: &'a C, db: &'a C,
@ -190,7 +190,7 @@ where
exec_insert_without_returning(self.query, db) exec_insert_without_returning(self.query, db)
} }
/// Execute an insert operation and return the inserted model (use `RETURNING` syntax if database supported) /// Execute an insert operation and return the inserted model (use `RETURNING` syntax if supported)
pub fn exec_with_returning<'a, C>( pub fn exec_with_returning<'a, C>(
self, self,
db: &'a C, db: &'a C,

View File

@ -46,7 +46,7 @@ where
Updater::new(self.query).exec(db).await Updater::new(self.query).exec(db).await
} }
/// Execute an update operation and return the updated model (use `RETURNING` syntax if database supported) /// Execute an update operation and return the updated model (use `RETURNING` syntax if supported)
/// ///
/// # Panics /// # Panics
/// ///

View File

@ -758,7 +758,6 @@ pub async fn linked() -> Result<(), DbErr> {
.build(sea_orm::DatabaseBackend::MySql) .build(sea_orm::DatabaseBackend::MySql)
.to_string(), .to_string(),
[ [
// FIXME: This might be faulty!
"SELECT `baker`.`id` AS `A_id`,", "SELECT `baker`.`id` AS `A_id`,",
"`baker`.`name` AS `A_name`,", "`baker`.`name` AS `A_name`,",
"`baker`.`contact_details` AS `A_contact_details`,", "`baker`.`contact_details` AS `A_contact_details`,",