| 568 | } |
| 569 | |
| 570 | DatabaseCursor::Status SQLiteCursor::Next(DataStream& key, DataStream& value) |
| 571 | { |
| 572 | int res = sqlite3_step(m_cursor_stmt); |
| 573 | if (res == SQLITE_DONE) { |
| 574 | return Status::DONE; |
| 575 | } |
| 576 | if (res != SQLITE_ROW) { |
| 577 | LogWarning("Unable to execute cursor step: %s", sqlite3_errstr(res)); |
| 578 | return Status::FAIL; |
| 579 | } |
| 580 | |
| 581 | key.clear(); |
| 582 | value.clear(); |
| 583 | |
| 584 | // Leftmost column in result is index 0 |
| 585 | key.write(SpanFromBlob(m_cursor_stmt, 0)); |
| 586 | value.write(SpanFromBlob(m_cursor_stmt, 1)); |
| 587 | return Status::MORE; |
| 588 | } |
| 589 | |
| 590 | SQLiteCursor::~SQLiteCursor() |
| 591 | { |