summaryrefslogtreecommitdiff
path: root/src/database/select_query.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/database/select_query.hpp')
-rw-r--r--src/database/select_query.hpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/database/select_query.hpp b/src/database/select_query.hpp
index 80d1424..d0c1d59 100644
--- a/src/database/select_query.hpp
+++ b/src/database/select_query.hpp
@@ -25,7 +25,7 @@ extract_row_value(Statement& statement, const int i)
{
const auto size = sqlite3_column_bytes(statement.get(), i);
const unsigned char* str = sqlite3_column_text(statement.get(), i);
- std::string result(reinterpret_cast<const char*>(str), size);
+ std::string result(reinterpret_cast<const char*>(str), static_cast<std::size_t>(size));
return result;
}
@@ -62,10 +62,9 @@ struct SelectQuery: public Query
insert_col_name()
{
using ColumnsType = std::tuple<T...>;
- ColumnsType tuple{};
- auto value = std::get<N>(tuple);
+ using ColumnType = typename std::remove_reference<decltype(std::get<N>(std::declval<ColumnsType>()))>::type;
- this->body += " "s + value.name;
+ this->body += " "s + ColumnType::name;
if (N < (sizeof...(T) - 1))
this->body += ", ";