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

Function fetch_user

backend/src/psql/user.rs:30–45  ·  view source on GitHub ↗
(_read_prefixes: &RepoIds, user_id: &String, pool: &PgPool)

Source from the content-addressed store, hash-verified

28}
29
30pub async fn fetch_user(_read_prefixes: &RepoIds, user_id: &String, pool: &PgPool) -> Result<Row> {
31 // TODO: Filter on query_ids
32 let query = format!(
33 "select
34 {USER_FIELDS}
35 from users u
36 left join users_repositories ur on u.id = ur.user_id
37 where u.id = $1::uuid
38 group by u.id"
39 );
40 let row = sqlx::query_as::<_, Row>(&query)
41 .bind(user_id)
42 .fetch_one(pool)
43 .await?;
44 Ok(row)
45}
46
47pub struct UserLoader {
48 pool: PgPool,

Callers 2

callMethod · 0.85
callMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected