summaryrefslogtreecommitdiff
path: root/src/database/query.hpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-08-23 20:30:11 +0200
committerlouiz’ <louiz@louiz.org>2018-08-23 20:30:11 +0200
commit0b51e3828116f6847865fae93893eb97a10d1cc2 (patch)
tree39abd4550930b6c5d0fc99fa75ddab0724970371 /src/database/query.hpp
parent4a583c7b7ea6046202a4cb7c0437241c8f597356 (diff)
downloadbiboumi-0b51e3828116f6847865fae93893eb97a10d1cc2.tar.gz
biboumi-0b51e3828116f6847865fae93893eb97a10d1cc2.tar.bz2
biboumi-0b51e3828116f6847865fae93893eb97a10d1cc2.tar.xz
biboumi-0b51e3828116f6847865fae93893eb97a10d1cc2.zip
MaxHistoryLength now has some sensible default value if the user set a negative one
Diffstat (limited to 'src/database/query.hpp')
-rw-r--r--src/database/query.hpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/database/query.hpp b/src/database/query.hpp
index ba28b1a..ae6e946 100644
--- a/src/database/query.hpp
+++ b/src/database/query.hpp
@@ -12,13 +12,14 @@
#include <string>
void actual_bind(Statement& statement, const std::string& value, int index);
-void actual_bind(Statement& statement, const std::int64_t& value, int index);
-template <typename T, typename std::enable_if_t<std::is_integral<T>::value>* = 0>
+void actual_bind(Statement& statement, const OptionalBool& value, int index);
+template <typename T>
void actual_bind(Statement& statement, const T& value, int index)
{
- actual_bind(statement, static_cast<std::int64_t>(value), index);
+ static_assert(std::is_integral<T>::value,
+ "Only a string, an optional-bool or an integer can be used.");
+ statement.bind_int64(index, static_cast<int>(value));
}
-void actual_bind(Statement& statement, const OptionalBool& value, int index);
#ifdef DEBUG_SQL_QUERIES
#include <utils/scopetimer.hpp>