Prepping account members for enriching user data.

This commit is contained in:
2026-10-12 13:43:43 +02:00
parent d2993eafe0
commit 945ae46dbe
7 changed files with 154 additions and 29 deletions
+18
View File
@@ -49,6 +49,24 @@ where
.map_err(DatabaseError::from)
}
pub async fn get_by_ids<'e, E>(executor: E, ids: &[Uuid]) -> Result<Vec<UserRow>, DatabaseError>
where
E: sqlx::Executor<'e, Database = sqlx::Postgres>,
{
sqlx::query_as!(
UserRow,
r#"
SELECT id
FROM users
WHERE id = ANY($1)
"#,
ids,
)
.fetch_all(executor)
.await
.map_err(DatabaseError::from)
}
pub async fn upsert<'e, E>(executor: E, user: UserRow) -> Result<Upsert<UserRow>, DatabaseError>
where
E: sqlx::Executor<'e, Database = sqlx::Postgres>,