diff options
author | louiz’ <louiz@louiz.org> | 2019-11-03 22:20:44 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2019-11-06 17:22:38 +0100 |
commit | cedf4412818fe15cdbd269a443c27d695106e69e (patch) | |
tree | 492adc4f6579d36d433be5160dee400c25fbae0f | |
parent | bd41bc8b0270b83e0efd331eb010fa4347a2ef67 (diff) | |
download | biboumi-cedf4412818fe15cdbd269a443c27d695106e69e.tar.gz biboumi-cedf4412818fe15cdbd269a443c27d695106e69e.tar.bz2 biboumi-cedf4412818fe15cdbd269a443c27d695106e69e.tar.xz biboumi-cedf4412818fe15cdbd269a443c27d695106e69e.zip |
Use the right int64 type for INTEGER rows in the db
-rw-r--r-- | src/database/database.hpp | 8 | ||||
-rw-r--r-- | src/database/query.hpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/database/database.hpp b/src/database/database.hpp index 4a413be..a53f87b 100644 --- a/src/database/database.hpp +++ b/src/database/database.hpp @@ -63,8 +63,8 @@ class Database struct EncodingIn: Column<std::string> { static constexpr auto name = "encodingin_"; }; - struct MaxHistoryLength: Column<int> { static constexpr auto name = "maxhistorylength_"; - MaxHistoryLength(): Column<int>(20) {} }; + struct MaxHistoryLength: Column<std::int64_t> { static constexpr auto name = "maxhistorylength_"; + MaxHistoryLength(): Column<std::int64_t>(20) {} }; struct RecordHistory: Column<bool> { static constexpr auto name = "recordhistory_"; RecordHistory(): Column<bool>(true) {}}; @@ -86,8 +86,8 @@ class Database struct Address: Column<std::string> { static constexpr auto name = "address_"; }; - struct ThrottleLimit: Column<long int> { static constexpr auto name = "throttlelimit_"; - ThrottleLimit(): Column<long int>(10) {} }; + struct ThrottleLimit: Column<std::int64_t> { static constexpr auto name = "throttlelimit_"; + ThrottleLimit(): Column<std::int64_t>(10) {} }; using MucLogLineTable = Table<Id, Uuid, Owner, IrcChanName, IrcServerName, Date, Body, Nick>; using MucLogLine = MucLogLineTable::RowType; diff --git a/src/database/query.hpp b/src/database/query.hpp index ae6e946..c89371f 100644 --- a/src/database/query.hpp +++ b/src/database/query.hpp @@ -18,7 +18,7 @@ void actual_bind(Statement& statement, const T& value, int 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)); + statement.bind_int64(index, static_cast<std::int64_t>(value)); } #ifdef DEBUG_SQL_QUERIES |