8 #define MYSQLPP_MYSQL_HEADERS_BURIED
9 #include <mysql++/mysql++.h>
10 #include <mysql++/sql_types.h>
12 #include "../logging.h"
19 typedef mysqlpp::sql_bigint_unsigned
Index;
21 typedef mysqlpp::StoreQueryResult
Results;
23 bool connect(
const std::string& db,
const std::string& host,
const std::string& user,
const std::string& password) {
24 return conn.connect(db.c_str(), host.c_str(), user.c_str(), password.c_str());
31 template<
typename... Args>
33 stmt.execute(args...);
35 template<
typename... Args>
38 mysqlpp::SimpleResult res = s.execute(args...);
39 return res.insert_id();
41 template<
typename... Args>
44 return s.store(args...);
50 return res[0][name.c_str()];
std::size_t size(const Results &res)
bool connect(const std::string &db, const std::string &host, const std::string &user, const std::string &password)
std::unique_ptr< sql::ResultSet > Results
Results type.
Statement prepare(const std::string &query)
std::unique_ptr< sql::Connection > conn
void execute(Statement &stmt, const Args &... args)
std::unique_ptr< sql::PreparedStatement > Statement
Statement type.
mysqlpp::sql_bigint_unsigned Index
mysqlpp::StoreQueryResult Results
std::size_t Index
Indec type.
Index getIndex(const Results &res, const std::string &name)
Index insert(const std::string &query, const Args &... args)
Results select(const std::string &query, const Args &... args)