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

Method insert

basics/todo/src/model.rs:31–43  ·  view source on GitHub ↗
(todo: NewTask, connection: &SqlitePool)

Source from the content-addressed store, hash-verified

29 }
30
31 pub async fn insert(todo: NewTask, connection: &SqlitePool) -> Result<(), sqlx::Error> {
32 sqlx::query!(
33 r#"
34 INSERT INTO tasks (description)
35 VALUES ($1)
36 "#,
37 todo.description,
38 )
39 .execute(connection)
40 .await?;
41
42 Ok(())
43 }
44
45 pub async fn toggle_with_id(id: i32, connection: &SqlitePool) -> Result<(), sqlx::Error> {
46 sqlx::query!(

Callers 15

callMethod · 0.80
cache_itemFunction · 0.80
indexFunction · 0.80
do_somethingFunction · 0.80
loginFunction · 0.80
add_client_to_roomMethod · 0.80
newMethod · 0.80
handleMethod · 0.80
defaultMethod · 0.80
handleMethod · 0.80
newMethod · 0.80
connectMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected