mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-14 04:24:20 +01:00
cursor: handle current() graciously when there's no data
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user