7 namespace horizon::SQLite {
26 template <
class T> T get(
int idx)
const
35 template <
class... Ts> std::tuple<Ts...> get_columns(
typename convert<Ts>::to_int... idxs)
const
37 return std::make_tuple(get(idxs, Ts())...);
40 void bind(
int idx,
const std::string &v,
bool copy =
true);
41 void bind(
const char *name,
const std::string &v,
bool copy =
true);
42 void bind(
int idx,
int v);
43 void bind(
const char *name,
int v);
51 std::string get(
int idx, std::string)
const;
52 int get(
int idx,
int)
const;
55 class Error :
public std::runtime_error {
57 Error(
int a_rc,
const char *what) : std::runtime_error(what), rc(a_rc)
67 Database(
const std::string &filename,
int flags = SQLITE_OPEN_READONLY,
int timeout_ms = 0);
69 void execute(
const std::string &query);
70 void execute(
const char *query);
71 int get_user_version();
74 sqlite3 *db =
nullptr;