MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / delete_note

Method delete_note

examples/graphql_example/service/src/mutation.rs:41–49  ·  view source on GitHub ↗
(db: &DbConn, id: i32)

Source from the content-addressed store, hash-verified

39 }
40
41 pub async fn delete_note(db: &DbConn, id: i32) -> Result<DeleteResult, DbErr> {
42 let note: note::ActiveModel = Note::find_by_id(id)
43 .one(db)
44 .await?
45 .ok_or(DbErr::Custom("Cannot find note.".to_owned()))
46 .map(Into::into)?;
47
48 note.delete(db).await
49 }
50
51 pub async fn delete_all_notes(db: &DbConn) -> Result<DeleteResult, DbErr> {
52 Note::delete_many().exec(db).await

Callers

nothing calls this directly

Calls 2

oneMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected