Function
fetch_user
(_read_prefixes: &RepoIds, user_id: &String, pool: &PgPool)
Source from the content-addressed store, hash-verified
| 28 | } |
| 29 | |
| 30 | pub 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 | |
| 47 | pub struct UserLoader { |
| 48 | pool: PgPool, |
Tested by
no test coverage detected