| 599 | } |
| 600 | |
| 601 | std::unique_ptr<DatabaseCursor> SQLiteBatch::GetNewCursor() |
| 602 | { |
| 603 | if (!m_database.m_db) return nullptr; |
| 604 | auto cursor = std::make_unique<SQLiteCursor>(); |
| 605 | |
| 606 | const char* stmt_text = "SELECT key, value FROM main"; |
| 607 | int res = sqlite3_prepare_v2(m_database.m_db, stmt_text, -1, &cursor->m_cursor_stmt, nullptr); |
| 608 | if (res != SQLITE_OK) { |
| 609 | throw std::runtime_error(strprintf( |
| 610 | "%s: Failed to setup cursor SQL statement: %s\n", __func__, sqlite3_errstr(res))); |
| 611 | } |
| 612 | |
| 613 | return cursor; |
| 614 | } |
| 615 | |
| 616 | std::unique_ptr<DatabaseCursor> SQLiteBatch::GetNewPrefixCursor(std::span<const std::byte> prefix) |
| 617 | { |
no outgoing calls
no test coverage detected