Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef __VEREIGN_SQLITE_STATEMENT_HH
#define __VEREIGN_SQLITE_STATEMENT_HH
#include <vereign/bytes/view.hh>
#include <vereign/bytes/bytes.hh>
#include <string>
struct sqlite3;
struct sqlite3_stmt;
namespace vereign::sqlite {
class Statement {
private:
friend class Connection;
explicit Statement(sqlite3* db, sqlite3_stmt* stmt);
public:
~Statement();
void BindBlob(int index, bytes::View blob);
void BindText(int index, const std::string& text);
auto Step() -> bool;
auto GetColumnBlob(int index) -> bytes::View;
auto GetColumnText(int index) -> std::string_view;
void Reset();
void ResetAndClearBindings();
void Finalize();
private:
sqlite3* db_;
sqlite3_stmt* stmt_;
};
} // namespace vereign::sqlite
#endif // __VEREIGN_SQLITE_STATEMENT_HH