stabilized app
This commit is contained in:
committed by
Torsten (PC)
parent
51fd9fcd13
commit
1451225978
@@ -2,24 +2,25 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
#include <sstream>
|
||||
#include <pgsql/libpq-fe.h>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <pqxx/pqxx>
|
||||
|
||||
class Database
|
||||
{
|
||||
class Database {
|
||||
public:
|
||||
Database(const std::string &conninfo);
|
||||
|
||||
typedef std::unordered_map<std::string, std::string> FieldMap;
|
||||
typedef std::vector<FieldMap> FieldList;
|
||||
|
||||
std::vector<std::map<std::string, std::string>> query(const std::string &sql);
|
||||
void prepare(const std::string &stmtName, const std::string &sql);
|
||||
std::vector<std::unordered_map<std::string,std::string>> execute(
|
||||
FieldList execute(
|
||||
const std::string &stmtName,
|
||||
const std::vector<std::string> ¶ms = {}
|
||||
);
|
||||
void remove(const std::string &stmtName);
|
||||
bool isOpen() const { return connection_ && connection_->is_open(); }
|
||||
bool isValid() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user