diff options
Diffstat (limited to 'server/src/database.h')
-rw-r--r-- | server/src/database.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/server/src/database.h b/server/src/database.h index 157cf6d..51c0f1a 100644 --- a/server/src/database.h +++ b/server/src/database.h @@ -28,10 +28,16 @@ #define __PRACRO_DATABASE_H__ #include <pqxx/pqxx> + #include <string> #include "transaction.h" +#include "template.h" #include <time.h> +#include <map> + +typedef std::map< std::string, std::string > Fields; + class Database { public: Database(std::string hostname = "localhost", @@ -39,13 +45,17 @@ public: std::string password = "pracro"); ~Database(); - int post(std::string &user, std::string &cpr, time_t now, Commit &commit); - // Make a commit to the db - void commit() {} + void commit(std::string user, + std::string cpr, + Macro ¯o, + Fields &fields, + time_t now = time(NULL)); // Get a list of values from the db - void getValues() {} + Fields getValues(std::string cpr, + std::vector< std::string > &fieldnames, + time_t oldest = 0); // Connect to the db void connect() {} |