(id: i32, connection: &SqlitePool)
| 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!( |
nothing calls this directly
no outgoing calls
no test coverage detected