summaryrefslogtreecommitdiff
path: root/src/database/datetime_writer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/database/datetime_writer.hpp')
-rw-r--r--src/database/datetime_writer.hpp32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/database/datetime_writer.hpp b/src/database/datetime_writer.hpp
deleted file mode 100644
index b104911..0000000
--- a/src/database/datetime_writer.hpp
+++ /dev/null
@@ -1,32 +0,0 @@
-#pragma once
-
-#include <utils/datetime.hpp>
-#include <database/engine.hpp>
-
-#include <logger/logger.hpp>
-#include <database/postgresql_engine.hpp>
-#include <database/sqlite3_engine.hpp>
-
-class DatetimeWriter
-{
-public:
- DatetimeWriter(DateTime datetime, const DatabaseEngine& engine):
- datetime(datetime),
- engine(engine)
- {}
-
- long double get_value() const
- {
- const long double epoch_duration = this->datetime.epoch().count();
- const long double epoch_seconds = epoch_duration / std::chrono::system_clock::period::den;
- return this->engine.epoch_to_floating_value(epoch_seconds);
- }
- std::string escape_param_number(int value) const
- {
- return this->engine.escape_param_number(value);
- }
-
-private:
- const DateTime datetime;
- const DatabaseEngine& engine;
-};