Refactor that fixes a compilation issue in Release mode

Some template specialization were not found, because they were not declared
at the point they were used.

We moved things around, things are less inter-dependant, and also now it
works.
This commit is contained in:
louiz’
2018-04-13 23:35:06 +02:00
parent de8267fa3f
commit 4bd7b6981b
13 changed files with 162 additions and 148 deletions
+21
View File
@@ -0,0 +1,21 @@
#include <database/insert_query.hpp>
template <>
std::string before_value<Database::Date>()
{
if (Database::engine_type() == DatabaseEngine::EngineType::Sqlite3)
return "julianday(";
if (Database::engine_type() == DatabaseEngine::EngineType::Postgresql)
return "to_timestamp(";
return {};
}
template <>
std::string after_value<Database::Date>()
{
if (Database::engine_type() == DatabaseEngine::EngineType::Sqlite3)
return ", \"unixepoch\")";
if (Database::engine_type() == DatabaseEngine::EngineType::Postgresql)
return ")";
return {};
}