Return account details.

This commit is contained in:
2026-09-27 11:50:59 +02:00
parent 26a370aa31
commit 406f30ef80
7 changed files with 239 additions and 33 deletions
+18
View File
@@ -62,6 +62,24 @@ where
.map_err(DatabaseError::from)
}
pub async fn get_by_ids<'e, E>(executor: E, ids: &[Uuid]) -> Result<Vec<AccountRow>, DatabaseError>
where
E: sqlx::Executor<'e, Database = sqlx::Postgres>,
{
sqlx::query_as!(
AccountRow,
r#"
SELECT id, name
FROM accounts
WHERE id = ANY($1)
"#,
ids,
)
.fetch_all(executor)
.await
.map_err(DatabaseError::from)
}
pub async fn upsert<'e, E>(
executor: E,
account: AccountRow,