mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2024-12-28 18:18:52 +00:00
5b9dd10cbe
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.
36 lines
588 B
C++
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
|