1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-29 03:19:44 +00:00
OpenMW/components/sqlite3/transaction.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
588 B
C++
Raw Normal View History

2021-10-16 11:03:15 +00:00
#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,
};
2021-10-16 11:03:15 +00:00
class Transaction
{
public:
explicit Transaction(sqlite3& db, TransactionMode mode = TransactionMode::Default);
2021-10-16 11:03:15 +00:00
void commit();
private:
std::unique_ptr<sqlite3, Rollback> mDb;
};
}
#endif