MCPcopy Create free account
hub / github.com/actix/examples / toggle_with_id

Method toggle_with_id

basics/todo/src/model.rs:45–58  ·  view source on GitHub ↗
(id: i32, connection: &SqlitePool)

Source from the content-addressed store, hash-verified

43 }
44
45 pub async fn toggle_with_id(id: i32, connection: &SqlitePool) -> Result<(), sqlx::Error> {
46 sqlx::query!(
47 r#"
48 UPDATE tasks
49 SET completed = NOT completed
50 WHERE id = $1
51 "#,
52 id
53 )
54 .execute(connection)
55 .await?;
56
57 Ok(())
58 }
59
60 pub async fn delete_with_id(id: i32, connection: &SqlitePool) -> Result<(), sqlx::Error> {
61 sqlx::query!(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected