MCPcopy Create free account
hub / github.com/Rustixir/darkbird / handle

Method handle

example/migrate_to_another_database.rs:50–57  ·  view source on GitHub ↗
(&self, session: &DatabaseSession, key: &i64, document: &User)

Source from the content-addressed store, hash-verified

48#[async_trait]
49impl 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected