6#ifndef ATLASGAMEMANAGER_TRANSACTION_HPP
7#define ATLASGAMEMANAGER_TRANSACTION_HPP
9#include <tracy/Tracy.hpp>
23 template <
bool is_commitable = false >
34 std::lock_guard< std::mutex >
guard;
38 if constexpr ( is_commitable )
39 sqlite3_exec( &
Database::ref(),
"BEGIN TRANSACTION;",
nullptr,
nullptr,
nullptr );
44 template < std::u
int64_t size >
47 const std::string_view str_view { std::string_view( raw_str, size - 1 ) };
48 return *
this << str_view;
atlas::database::TransactionBase< true > Transaction
Definition Transaction.hpp:59
static sqlite3 & ref()
Returns a ref to the sqlite DB.
Definition Database.cpp:22
~TransactionBase() noexcept(false)
std::lock_guard< std::mutex > guard
Definition Transaction.hpp:34
Binder operator<<(std::string_view sql)
Definition Transaction.hpp:36
bool m_finished
Definition Transaction.hpp:32
TransactionBase & operator=(const TransactionBase &other)=delete
TransactionBase(const TransactionBase &)=delete
TransactionBase(TransactionBase &&)=delete
Binder operator<<(const char(&raw_str)[size - 1])
Definition Transaction.hpp:45
std::mutex self_mtx
Definition Transaction.hpp:33