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

Method load

backend/src/psql/repository.rs:98–121  ·  view source on GitHub ↗
(&self, ids: &[String])

Source from the content-addressed store, hash-verified

96 type Error = Error;
97
98 async fn load(&self, ids: &[String]) -> Result<HashMap<String, Self::Value>> {
99 log::debug!("batch load repositories {:?}", ids);
100
101 let query = format!(
102 r#"
103 select
104 {REPOSITORY_FIELDS}
105 {REPOSITORY_JOINS}
106 where r.id = any($1::uuid[])
107 and r.id = any($2::uuid[])
108 {REPOSITORY_GROUP_BY}
109 "#
110 );
111 let rows = sqlx::query_as::<_, Row>(&query)
112 .bind(ids)
113 .bind(self.viewer.read_repo_ids.to_vec())
114 .fetch_all(&self.pool)
115 .await?;
116
117 Ok(rows
118 .iter()
119 .map(|r| (r.id.to_string(), r.to_repository()))
120 .collect::<HashMap<_, _>>())
121 }
122}
123
124pub struct SelectRepository {

Callers

nothing calls this directly

Calls 4

fetch_allMethod · 0.80
to_vecMethod · 0.80
to_repositoryMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected