1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-28 18:18:52 +00:00
OpenMW/components/sqlite3/transaction.hpp
elsid 5b9dd10cbe
Limit max navmeshdb file size
Use "pragma max_page_count" to define max allowed file size in combination with
"pragma page_size" based on a new setting "max navmeshdb file size".

* Stop navmeshtool on the first db error.
* Disable writes to db in the engine on first "database or disk is full"
  SQLite3 error. There is no special error code for this error.
* Change default "write to navmeshdb" to true.
* Use time intervals for transaction duration instead of number of changes.
2022-03-18 19:08:46 +01:00

36 lines
588 B
C++

#ifndef OPENMW_COMPONENTS_SQLITE3_TRANSACTION_H
#define OPENMW_COMPONENTS_SQLITE3_TRANSACTION_H
#include <memory>
struct sqlite3;
namespace Sqlite3
{
struct Rollback
{
void operator()(sqlite3* handle) const;
};
enum class TransactionMode
{
Default,
Deferred,
Immediate,
Exclusive,
};
class Transaction
{
public:
explicit Transaction(sqlite3& db, TransactionMode mode = TransactionMode::Default);
void commit();
private:
std::unique_ptr<sqlite3, Rollback> mDb;
};
}
#endif