summaryrefslogtreecommitdiff
path: root/src/database
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-07-08 14:04:35 +0200
committerlouiz’ <louiz@louiz.org>2017-07-08 14:04:35 +0200
commitfaed8952cb6ba063e5424364df69cef193fb736e (patch)
treec7a4b744db70bb12b7dca9fcc6f724ab0a6993da /src/database
parent7a9b2dca06c390531ec7f5d85e58cc27e17e7b74 (diff)
downloadbiboumi-faed8952cb6ba063e5424364df69cef193fb736e.tar.gz
biboumi-faed8952cb6ba063e5424364df69cef193fb736e.tar.bz2
biboumi-faed8952cb6ba063e5424364df69cef193fb736e.tar.xz
biboumi-faed8952cb6ba063e5424364df69cef193fb736e.zip
Remove a bunch of useless string_literal usage
Diffstat (limited to 'src/database')
-rw-r--r--src/database/select_query.hpp2
-rw-r--r--src/database/table.cpp2
-rw-r--r--src/database/table.hpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/database/select_query.hpp b/src/database/select_query.hpp
index f4d71af..872001c 100644
--- a/src/database/select_query.hpp
+++ b/src/database/select_query.hpp
@@ -79,7 +79,7 @@ struct SelectQuery: public Query
using ColumnsType = std::tuple<T...>;
using ColumnType = typename std::remove_reference<decltype(std::get<N>(std::declval<ColumnsType>()))>::type;
- this->body += " "s + ColumnType::name;
+ this->body += " " + std::string{ColumnType::name};
if (N < (sizeof...(T) - 1))
this->body += ", ";
diff --git a/src/database/table.cpp b/src/database/table.cpp
index 5929f33..160f426 100644
--- a/src/database/table.cpp
+++ b/src/database/table.cpp
@@ -4,7 +4,7 @@ std::set<std::string> get_all_columns_from_table(sqlite3* db, const std::string&
{
std::set<std::string> result;
char* errmsg;
- std::string query{"PRAGMA table_info("s + table_name + ")"};
+ std::string query{"PRAGMA table_info(" + table_name + ")"};
log_debug(query);
int res = sqlite3_exec(db, query.data(), [](void* param, int columns_nb, char** columns, char**) -> int {
constexpr int name_column = 1;
diff --git a/src/database/table.hpp b/src/database/table.hpp
index f2f70bb..c9e35d3 100644
--- a/src/database/table.hpp
+++ b/src/database/table.hpp
@@ -17,7 +17,7 @@ template <typename ColumnType>
void add_column_to_table(sqlite3* db, const std::string& table_name)
{
const std::string name = ColumnType::name;
- std::string query{"ALTER TABLE "s + table_name + " ADD " + ColumnType::name + " " + TypeToSQLType<typename ColumnType::real_type>::type};
+ std::string query{"ALTER TABLE " + table_name + " ADD " + ColumnType::name + " " + TypeToSQLType<typename ColumnType::real_type>::type};
log_debug(query);
char* error;
const auto result = sqlite3_exec(db, query.data(), nullptr, nullptr, &error);