| 685 | } |
| 686 | |
| 687 | bool SQLiteBatch::TxnAbort() |
| 688 | { |
| 689 | if (!m_database.m_db || !m_txn) return false; |
| 690 | Assert(m_database.HasActiveTxn()); |
| 691 | int res = Assert(m_exec_handler)->Exec(m_database, "ROLLBACK TRANSACTION"); |
| 692 | if (res != SQLITE_OK) { |
| 693 | LogWarning("SQLiteBatch: Failed to abort the transaction"); |
| 694 | } else { |
| 695 | m_txn = false; |
| 696 | m_database.m_write_semaphore.release(); |
| 697 | } |
| 698 | return res == SQLITE_OK; |
| 699 | } |
| 700 | |
| 701 | std::unique_ptr<SQLiteDatabase> MakeSQLiteDatabase(const fs::path& path, const DatabaseOptions& options, DatabaseStatus& status, bilingual_str& error) |
| 702 | { |