This commit is contained in:
Mike Dilger 2022-12-27 16:30:05 +13:00
parent bd0548f19c
commit daac5124bf

View File

@ -52,6 +52,10 @@ impl DbEvent {
} }
pub async fn fetch_by_ids(ids: Vec<IdHex>) -> Result<Vec<DbEvent>, Error> { pub async fn fetch_by_ids(ids: Vec<IdHex>) -> Result<Vec<DbEvent>, Error> {
if ids.is_empty() {
return Ok(vec![]);
}
let sql = format!( let sql = format!(
"SELECT id, raw, pubkey, created_at, kind, content, ots FROM event WHERE id IN ({})", "SELECT id, raw, pubkey, created_at, kind, content, ots FROM event WHERE id IN ({})",
repeat_vars(ids.len()) repeat_vars(ids.len())