24 lines
521 B
C++
24 lines
521 B
C++
#pragma once
|
|
#include <sqlite3.h>
|
|
#include <sstream>
|
|
|
|
class Transaction {
|
|
private:
|
|
sqlite3 * const destination;
|
|
unsigned queryCount;
|
|
std::stringstream queryStream;
|
|
|
|
void Reset();
|
|
|
|
public:
|
|
void AddStatement(std::string const & statement);
|
|
|
|
unsigned StatementCount() const;
|
|
|
|
// Runs the statements inserted as a single transaction
|
|
// Returns a SQLite status code (0 = OK) and then resets
|
|
// to a new transaction
|
|
int Execute();
|
|
|
|
Transaction(sqlite3 * const databaseToInsertIn);
|
|
}; |