Use the right int64 type for INTEGER rows in the db

This commit is contained in:
louiz’
2019-11-06 17:22:38 +01:00
parent bd41bc8b02
commit cedf441281
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -63,8 +63,8 @@ class Database
struct EncodingIn: Column<std::string> { static constexpr auto name = "encodingin_"; }; struct EncodingIn: Column<std::string> { static constexpr auto name = "encodingin_"; };
struct MaxHistoryLength: Column<int> { static constexpr auto name = "maxhistorylength_"; struct MaxHistoryLength: Column<std::int64_t> { static constexpr auto name = "maxhistorylength_";
MaxHistoryLength(): Column<int>(20) {} }; MaxHistoryLength(): Column<std::int64_t>(20) {} };
struct RecordHistory: Column<bool> { static constexpr auto name = "recordhistory_"; struct RecordHistory: Column<bool> { static constexpr auto name = "recordhistory_";
RecordHistory(): Column<bool>(true) {}}; RecordHistory(): Column<bool>(true) {}};
@@ -86,8 +86,8 @@ class Database
struct Address: Column<std::string> { static constexpr auto name = "address_"; }; struct Address: Column<std::string> { static constexpr auto name = "address_"; };
struct ThrottleLimit: Column<long int> { static constexpr auto name = "throttlelimit_"; struct ThrottleLimit: Column<std::int64_t> { static constexpr auto name = "throttlelimit_";
ThrottleLimit(): Column<long int>(10) {} }; ThrottleLimit(): Column<std::int64_t>(10) {} };
using MucLogLineTable = Table<Id, Uuid, Owner, IrcChanName, IrcServerName, Date, Body, Nick>; using MucLogLineTable = Table<Id, Uuid, Owner, IrcChanName, IrcServerName, Date, Body, Nick>;
using MucLogLine = MucLogLineTable::RowType; using MucLogLine = MucLogLineTable::RowType;
+1 -1
View File
@@ -18,7 +18,7 @@ void actual_bind(Statement& statement, const T& value, int index)
{ {
static_assert(std::is_integral<T>::value, static_assert(std::is_integral<T>::value,
"Only a string, an optional-bool or an integer can be used."); "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 #ifdef DEBUG_SQL_QUERIES