mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 18:18:03 +00:00
cursor: handle current() graciously when there's no data
This commit is contained in:
parent
fb5217959f
commit
5bdcfc9924
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue