diff --git a/SeaORM/docs/06-basic-crud/05-delete.md b/SeaORM/docs/06-basic-crud/05-delete.md index b6d523a6172..6225e342244 100644 --- a/SeaORM/docs/06-basic-crud/05-delete.md +++ b/SeaORM/docs/06-basic-crud/05-delete.md @@ -12,6 +12,15 @@ let res: DeleteResult = orange.delete(db).await?; assert_eq!(res.rows_affected, 1); ``` +## Delete by Primary Key + +Instead of selecting `Model` from the database then deleting it. You could also delete a row from database directly by its primary key. + +```rust +let res: DeleteResult = Fruit::delete_by_id(38).exec(db).await?; +assert_eq!(res.rows_affected, 1); +``` + ## Delete Many You can also delete multiple rows from the database without finding each `Model` with SeaORM select.