Return account details.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user