diff options
author | deva <deva> | 2008-05-23 14:55:39 +0000 |
---|---|---|
committer | deva <deva> | 2008-05-23 14:55:39 +0000 |
commit | 158915fafe286df69a68374032187ae283eb4ded (patch) | |
tree | 2f5b593ed9413039bb2b3b0828cb59cb226a39ba /server/src/database.h | |
parent | 5dac0856cb400a4f40280e7caae188781dac7b85 (diff) |
Did a lot of work on the database class.
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() {} |