| 521 | } |
| 522 | |
| 523 | bool SQLiteBatch::ExecStatement(sqlite3_stmt* stmt, std::span<const std::byte> blob) |
| 524 | { |
| 525 | if (!m_database.m_db) return false; |
| 526 | assert(stmt); |
| 527 | |
| 528 | // Bind: leftmost parameter in statement is index 1 |
| 529 | if (!BindBlobToStatement(stmt, 1, blob, "key")) return false; |
| 530 | |
| 531 | // Acquire semaphore if not previously acquired when creating a transaction. |
| 532 | if (!m_txn) m_database.m_write_semaphore.acquire(); |
| 533 | |
| 534 | // Execute |
| 535 | int res = sqlite3_step(stmt); |
| 536 | sqlite3_clear_bindings(stmt); |
| 537 | sqlite3_reset(stmt); |
| 538 | if (res != SQLITE_DONE) { |
| 539 | LogWarning("Unable to execute exec statement: %s", sqlite3_errstr(res)); |
| 540 | } |
| 541 | |
| 542 | if (!m_txn) m_database.m_write_semaphore.release(); |
| 543 | |
| 544 | return res == SQLITE_DONE; |
| 545 | } |
| 546 | |
| 547 | bool SQLiteBatch::EraseKey(DataStream&& key) |
| 548 | { |
nothing calls this directly
no test coverage detected