MCPcopy Create free account
hub / github.com/emwalker/digraph / load

Method load

backend/src/psql/user.rs:63–83  ·  view source on GitHub ↗
(&self, ids: &[String])

Source from the content-addressed store, hash-verified

61 type Error = Error;
62
63 async fn load(&self, ids: &[String]) -> Result<HashMap<String, Self::Value>> {
64 log::debug!("batch load users: {:?}", ids);
65
66 let query = format!(
67 "select
68 {USER_FIELDS}
69 from users u
70 left join users_repositories ur on u.id = ur.user_id
71 where u.id = any($1::uuid[])
72 group by u.id",
73 );
74 let rows = sqlx::query_as::<_, Row>(&query)
75 .bind(ids)
76 .fetch_all(&self.pool)
77 .await;
78
79 Ok(rows?
80 .iter()
81 .map(|r| (r.id.to_string(), r.to_owned()))
82 .collect::<HashMap<_, _>>())
83 }
84}
85
86pub struct UpsertRegisteredUser<'i> {

Callers

nothing calls this directly

Calls 2

fetch_allMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected