MCPcopy Create free account
hub / github.com/Rust-Web-Development/code / delete_question

Method delete_question

ch_07/src/store.rs:117–132  ·  view source on GitHub ↗
(
        &self,
        question_id: i32,
    )

Source from the content-addressed store, hash-verified

115 }
116
117 pub async fn delete_question(
118 &self,
119 question_id: i32,
120 ) -> Result<bool, Error> {
121 match sqlx::query("DELETE FROM questions WHERE id = $1")
122 .bind(question_id)
123 .execute(&self.connection)
124 .await
125 {
126 Ok(_) => Ok(true),
127 Err(e) => {
128 tracing::event!(tracing::Level::ERROR, "{:?}", e);
129 Err(Error::DatabaseQueryError)
130 }
131 }
132 }
133
134 pub async fn add_answer(
135 &self,

Callers 1

delete_questionFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected