diff --git a/include/sqlpp11/functions.h b/include/sqlpp11/functions.h index af8ebdb2..65fabab0 100644 --- a/include/sqlpp11/functions.h +++ b/include/sqlpp11/functions.h @@ -91,11 +91,11 @@ namespace sqlpp return { s }; } - template - auto flatten(const Expression& exp, const Context& context) -> verbatim_t> + template + auto flatten(const Expression& exp, Db& db) -> verbatim_t> { - static_assert(not make_parameter_list_t::type::size::value, "parameters not supported in flattened expressions"); - context.clear(); + static_assert(not make_parameter_list_t::size::value, "parameters are not allowed in flattened expressions"); + auto context = db.get_serializer_context(); serialize(exp, context); return { context.str() }; } @@ -164,7 +164,7 @@ namespace sqlpp template constexpr const char* get_sql_name(const T&) { - return T::type::_name_t::_get_name(); + return T::_name_t::_get_name(); } diff --git a/include/sqlpp11/insert.h b/include/sqlpp11/insert.h index 1475b5b6..afe2a5c9 100644 --- a/include/sqlpp11/insert.h +++ b/include/sqlpp11/insert.h @@ -94,7 +94,7 @@ namespace sqlpp no_into_t, no_insert_value_list_t>; - auto insert() + inline auto insert() -> blank_insert_t { return { blank_insert_t() }; diff --git a/include/sqlpp11/remove.h b/include/sqlpp11/remove.h index 3caf2d82..fce31e47 100644 --- a/include/sqlpp11/remove.h +++ b/include/sqlpp11/remove.h @@ -98,7 +98,7 @@ namespace sqlpp no_where_t >; - auto remove() + inline auto remove() -> blank_remove_t { return { blank_remove_t() }; diff --git a/include/sqlpp11/select.h b/include/sqlpp11/select.h index d3dab3a7..c7e92c4a 100644 --- a/include/sqlpp11/select.h +++ b/include/sqlpp11/select.h @@ -79,7 +79,7 @@ namespace sqlpp no_offset_t>; - blank_select_t select() // FIXME: These should be constexpr + inline blank_select_t select() // FIXME: These should be constexpr { return { }; } diff --git a/include/sqlpp11/verbatim_table.h b/include/sqlpp11/verbatim_table.h index 2e5fa27c..e0c248cd 100644 --- a/include/sqlpp11/verbatim_table.h +++ b/include/sqlpp11/verbatim_table.h @@ -82,7 +82,7 @@ namespace sqlpp }; - verbatim_table_t verbatim_table(std::string name) + inline verbatim_table_t verbatim_table(std::string name) { return { name }; }