summaryrefslogtreecommitdiff
path: root/src/ingestor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ingestor.cpp')
-rw-r--r--src/ingestor.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/ingestor.cpp b/src/ingestor.cpp
index d5dd4e2..a5a2e57 100644
--- a/src/ingestor.cpp
+++ b/src/ingestor.cpp
@@ -1,4 +1,7 @@
#include "ingestor.hpp"
+#include "sql.hpp"
+#include <connection.h>
+#include <modifycommand.h>
#include <scn/scan.h>
#include <syslog.h>
#include <utility>
@@ -74,4 +77,27 @@ namespace WebStat {
}
}
}
+
+ template<typename T>
+ void
+ Ingestor::storeEntity(const T &) const
+ {
+ }
+
+ void
+ Ingestor::storeEntity(const Entity entity) const
+ {
+ auto insert = dbconn->modify(SQL::ENTITY_INSERT, SQL::ENTITY_INSERT_OPTS);
+ insert->bindParamI(0, entity.first);
+ insert->bindParamS(1, entity.second);
+ insert->execute();
+ }
+
+ void
+ Ingestor::storeEntity(const std::optional<Entity> entity) const
+ {
+ if (entity) {
+ storeEntity(*entity);
+ }
+ }
}