summaryrefslogtreecommitdiff
path: root/server/src/database.h
diff options
context:
space:
mode:
authordeva <deva>2008-05-23 14:55:39 +0000
committerdeva <deva>2008-05-23 14:55:39 +0000
commit158915fafe286df69a68374032187ae283eb4ded (patch)
tree2f5b593ed9413039bb2b3b0828cb59cb226a39ba /server/src/database.h
parent5dac0856cb400a4f40280e7caae188781dac7b85 (diff)
Did a lot of work on the database class.
Diffstat (limited to 'server/src/database.h')
-rw-r--r--server/src/database.h18
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 &macro,
+ 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() {}