(&self, ids: &[String])
| 52 | type Error = Error; |
| 53 | |
| 54 | async fn load(&self, ids: &[String]) -> Result<HashMap<String, Self::Value>> { |
| 55 | log::debug!("batch load organizations: {:?}", ids); |
| 56 | |
| 57 | let rows = sqlx::query_as::<_, Row>( |
| 58 | "select |
| 59 | o.id, |
| 60 | o.name, |
| 61 | o.login |
| 62 | |
| 63 | from organizations o |
| 64 | where o.id = any($1::uuid[]) and (o.owner_id = $2::uuid or o.public)", |
| 65 | ) |
| 66 | .bind(ids) |
| 67 | .bind(&self.viewer.user_id) |
| 68 | .fetch_all(&self.pool) |
| 69 | .await |
| 70 | .map_err(Error::from)?; |
| 71 | |
| 72 | try_convert(rows) |
| 73 | } |
| 74 | } |
nothing calls this directly
no test coverage detected