(&self, session: &DatabaseSession, key: &i64, document: &User)
| 48 | #[async_trait] |
| 49 | impl Handler<i64, User> for WriteToDatabase { |
| 50 | async fn handle(&self, session: &DatabaseSession, key: &i64, document: &User) -> Result<(), Stop> { |
| 51 | if let (DatabaseSession::Postgres(client)) = session { |
| 52 | let res = client.query("Insert Into tbluser (key, document) values ($1::TEXT, $1::TEXT)", &[key, document.fullname]).await; |
| 53 | if Err(_) = res { |
| 54 | return Err(Stop) |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
| 60 |
nothing calls this directly
no outgoing calls
no test coverage detected