cursor: handle current() graciously when there's no data

This commit is contained in:
Piotr Sarna 2023-05-11 11:08:43 +02:00
parent fb5217959f
commit 5bdcfc9924

View file

@ -37,6 +37,9 @@ impl<
}
pub async fn current(&self) -> Result<Option<Row>> {
if self.index >= self.row_ids.len() {
return Ok(None);
}
let id = self.row_ids[self.index];
self.db.read(self.tx_id, id).await
}