34 lines
635 B
C++
34 lines
635 B
C++
#ifndef SQLITE_STATEMENT_H
|
|
#define SQLITE_STATEMENT_H
|
|
|
|
#include <sqlite3.h>
|
|
#include <string>
|
|
|
|
class SQLiteStatement {
|
|
private:
|
|
sqlite3 *db_;
|
|
sqlite3_stmt *stmt_; // Prepared statement
|
|
|
|
public:
|
|
SQLiteStatement(sqlite3 *db, const std::string &query);
|
|
~SQLiteStatement();
|
|
|
|
bool bind(int index, int value);
|
|
bool bind(int index, double value);
|
|
bool bind(int index, const std::string &value);
|
|
bool bindNull(int index);
|
|
|
|
bool execute();
|
|
bool step();
|
|
|
|
int changes();
|
|
|
|
void finalize();
|
|
void reset();
|
|
|
|
int getColumnCount() const;
|
|
std::string getColumnText(int column_index) const;
|
|
};
|
|
|
|
#endif // SQLITE_STATEMENT_H
|