diff options
Diffstat (limited to 'server/src/pracrodaopgsql.h')
-rw-r--r-- | server/src/pracrodaopgsql.h | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/server/src/pracrodaopgsql.h b/server/src/pracrodaopgsql.h index b226cfd..b3e0c86 100644 --- a/server/src/pracrodaopgsql.h +++ b/server/src/pracrodaopgsql.h @@ -32,25 +32,45 @@ #ifndef WITHOUT_DB -#include "pracrodao.h" +#include <string> #include <pqxx/pqxx> +#include "pracrodao.h" + class PracroDAOPgsql : public PracroDAO { public: - PracroDAOPgsql(std::string _host, std::string _port, std::string _user, std::string _passwd, std::string _dbname); + PracroDAOPgsql(std::string _host, std::string _port, + std::string _user, std::string _passwd, std::string _dbname); ~PracroDAOPgsql(); - void commitTransaction(std::string user, std::string patientid, Macro ¯o, Fields &fields, time_t now); - Values getLatestValues(std::string patientid, Macro *macro, Fieldnames &fieldnames, time_t oldest); - unsigned nrOfCommits(std::string patientid, std::string macroname, time_t oldest); + void commitTransaction(std::string user, + std::string patientid, + Macro ¯o, + Fields &fields, + time_t now); + Values getLatestValues(std::string patientid, + Macro *macro, + Fieldnames &fieldnames, + time_t oldest); + unsigned nrOfCommits(std::string patientid, + std::string macroname, + time_t oldest); void addFieldname(std::string name, std::string description); void delFieldname(std::string name); std::vector<Fieldname> getFieldnames(); + void commit(); + void discard(); + std::string serialise(); + void restore(const std::string &data); + private: pqxx::connection *conn; + pqxx::work *W; + + std::string statements; }; #endif/*WITHOUT_DB*/ |