Remove a bunch of useless string_literal usage

This commit is contained in:
louiz’
2017-07-08 14:04:35 +02:00
parent 7a9b2dca06
commit faed8952cb
11 changed files with 41 additions and 41 deletions
+1 -1
View File
@@ -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 += ", ";
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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);