mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-15 20:31:16 +08:00
Use clang-format to explicitly mark unused parameters
This commit is contained in:
parent
306ce63f2f
commit
c09a0b5ee8
@ -116,7 +116,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
auto avg(const distinct_t&, T t) -> avg_t<distinct_t, wrap_operand_t<T>>
|
auto avg(const distinct_t& /*unused*/, T t) -> avg_t<distinct_t, wrap_operand_t<T>>
|
||||||
{
|
{
|
||||||
static_assert(not contains_aggregate_function_t<wrap_operand_t<T>>::value,
|
static_assert(not contains_aggregate_function_t<wrap_operand_t<T>>::value,
|
||||||
"avg() cannot be used on an aggregate function");
|
"avg() cannot be used on an aggregate function");
|
||||||
|
@ -117,7 +117,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
auto count(const distinct_t&, T t) -> count_t<distinct_t, wrap_operand_t<T>>
|
auto count(const distinct_t& /*unused*/, T t) -> count_t<distinct_t, wrap_operand_t<T>>
|
||||||
{
|
{
|
||||||
static_assert(not contains_aggregate_function_t<wrap_operand_t<T>>::value,
|
static_assert(not contains_aggregate_function_t<wrap_operand_t<T>>::value,
|
||||||
"count() cannot be used on an aggregate function");
|
"count() cannot be used on an aggregate function");
|
||||||
|
@ -115,7 +115,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
auto sum(const distinct_t&, T t) -> sum_t<distinct_t, wrap_operand_t<T>>
|
auto sum(const distinct_t& /*unused*/, T t) -> sum_t<distinct_t, wrap_operand_t<T>>
|
||||||
{
|
{
|
||||||
static_assert(not contains_aggregate_function_t<wrap_operand_t<T>>::value,
|
static_assert(not contains_aggregate_function_t<wrap_operand_t<T>>::value,
|
||||||
"sum() cannot be used on an aggregate function");
|
"sum() cannot be used on an aggregate function");
|
||||||
|
@ -35,7 +35,7 @@ namespace sqlpp
|
|||||||
struct alias_operators
|
struct alias_operators
|
||||||
{
|
{
|
||||||
template <typename alias_provider>
|
template <typename alias_provider>
|
||||||
expression_alias_t<Expr, alias_provider> as(const alias_provider&) const
|
expression_alias_t<Expr, alias_provider> as(const alias_provider& /*unused*/) const
|
||||||
{
|
{
|
||||||
return {*static_cast<const Expr*>(this)};
|
return {*static_cast<const Expr*>(this)};
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ namespace sqlpp
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename Table>
|
template <typename Table>
|
||||||
auto all_of(Table) -> all_of_t<Table>
|
auto all_of(Table /*unused*/) -> all_of_t<Table>
|
||||||
{
|
{
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@ -60,7 +60,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = assert_no_stand_alone_all_of_t;
|
using _serialize_check = assert_no_stand_alone_all_of_t;
|
||||||
using T = all_of_t<Table>;
|
using T = all_of_t<Table>;
|
||||||
|
|
||||||
static Context& _(const T&, const Context&)
|
static Context& _(const T& /*unused*/, const Context& /*unused*/)
|
||||||
{
|
{
|
||||||
_serialize_check{};
|
_serialize_check{};
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ namespace sqlpp
|
|||||||
struct bad_expression
|
struct bad_expression
|
||||||
{
|
{
|
||||||
template <typename... T>
|
template <typename... T>
|
||||||
bad_expression(T&&...)
|
bad_expression(T&&... /*unused*/)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
using _traits = make_traits<ValueType, tag::is_expression>;
|
using _traits = make_traits<ValueType, tag::is_expression>;
|
||||||
|
@ -62,7 +62,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database, typename T>
|
template <typename Database, typename T>
|
||||||
boolean_expression_t<Database> boolean_expression(const Database&, T t)
|
boolean_expression_t<Database> boolean_expression(const Database& /*unused*/, T t)
|
||||||
{
|
{
|
||||||
return boolean_expression<Database>(t);
|
return boolean_expression<Database>(t);
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ namespace sqlpp
|
|||||||
class case_then_t
|
class case_then_t
|
||||||
{
|
{
|
||||||
template <typename Else>
|
template <typename Else>
|
||||||
auto _else_impl(consistent_t, Else else_) -> case_t<When, Then, Else>
|
auto _else_impl(consistent_t /*unused*/, Else else_) -> case_t<When, Then, Else>
|
||||||
{
|
{
|
||||||
return {_when, _then, else_};
|
return {_when, _then, else_};
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ namespace sqlpp
|
|||||||
class case_when_t
|
class case_when_t
|
||||||
{
|
{
|
||||||
template <typename Then>
|
template <typename Then>
|
||||||
auto _then_impl(consistent_t, Then t) -> case_then_t<When, wrap_operand_t<Then>>
|
auto _then_impl(consistent_t /*unused*/, Then t) -> case_then_t<When, wrap_operand_t<Then>>
|
||||||
{
|
{
|
||||||
return {_when, t};
|
return {_when, t};
|
||||||
}
|
}
|
||||||
@ -172,7 +172,7 @@ namespace sqlpp
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template <typename When>
|
template <typename When>
|
||||||
auto case_when_impl(consistent_t, When when) -> case_when_t<wrap_operand_t<When>>
|
auto case_when_impl(consistent_t /*unused*/, When when) -> case_when_t<wrap_operand_t<When>>
|
||||||
{
|
{
|
||||||
return {when};
|
return {when};
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename alias_provider>
|
template <typename alias_provider>
|
||||||
expression_alias_t<column_t, alias_provider> as(const alias_provider&) const
|
expression_alias_t<column_t, alias_provider> as(const alias_provider& /*unused*/) const
|
||||||
{
|
{
|
||||||
return {*this};
|
return {*this};
|
||||||
}
|
}
|
||||||
@ -92,13 +92,13 @@ namespace sqlpp
|
|||||||
return {*this, {rhs{t}}};
|
return {*this, {rhs{t}}};
|
||||||
}
|
}
|
||||||
|
|
||||||
auto operator=(null_t) const -> assignment_t<column_t, null_t>
|
auto operator=(null_t /*unused*/) const -> assignment_t<column_t, null_t>
|
||||||
{
|
{
|
||||||
static_assert(can_be_null_t<column_t>::value, "column cannot be null");
|
static_assert(can_be_null_t<column_t>::value, "column cannot be null");
|
||||||
return {*this, null_t{}};
|
return {*this, null_t{}};
|
||||||
}
|
}
|
||||||
|
|
||||||
auto operator=(default_value_t) const -> assignment_t<column_t, default_value_t>
|
auto operator=(default_value_t /*unused*/) const -> assignment_t<column_t, default_value_t>
|
||||||
{
|
{
|
||||||
return {*this, default_value_t{}};
|
return {*this, default_value_t{}};
|
||||||
}
|
}
|
||||||
@ -123,7 +123,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using T = column_t<Args1, Args2>;
|
using T = column_t<Args1, Args2>;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
context << name_of<typename T::_table>::char_ptr() << '.' << name_of<T>::char_ptr();
|
context << name_of<typename T::_table>::char_ptr() << '.' << name_of<T>::char_ptr();
|
||||||
return context;
|
return context;
|
||||||
|
@ -86,7 +86,7 @@ namespace sqlpp
|
|||||||
struct cte_ref_t;
|
struct cte_ref_t;
|
||||||
|
|
||||||
template <typename AliasProvider, typename Statement, typename... FieldSpecs>
|
template <typename AliasProvider, typename Statement, typename... FieldSpecs>
|
||||||
auto from_table(cte_t<AliasProvider, Statement, FieldSpecs...>) -> cte_ref_t<AliasProvider>
|
auto from_table(cte_t<AliasProvider, Statement, FieldSpecs...> /*unused*/) -> cte_ref_t<AliasProvider>
|
||||||
{
|
{
|
||||||
return cte_ref_t<AliasProvider>{};
|
return cte_ref_t<AliasProvider>{};
|
||||||
}
|
}
|
||||||
@ -208,7 +208,7 @@ namespace sqlpp
|
|||||||
auto _union_impl(Check, Rhs rhs) const -> inconsistent<Check>;
|
auto _union_impl(Check, Rhs rhs) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename Flag, typename Rhs>
|
template <typename Flag, typename Rhs>
|
||||||
auto _union_impl(consistent_t, Rhs rhs) const
|
auto _union_impl(consistent_t /*unused*/, Rhs rhs) const
|
||||||
-> cte_t<AliasProvider, cte_union_t<Flag, Statement, Rhs>, FieldSpecs...>
|
-> cte_t<AliasProvider, cte_union_t<Flag, Statement, Rhs>, FieldSpecs...>
|
||||||
{
|
{
|
||||||
return cte_union_t<Flag, Statement, Rhs>{_statement, rhs};
|
return cte_union_t<Flag, Statement, Rhs>{_statement, rhs};
|
||||||
@ -277,7 +277,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using T = cte_ref_t<AliasProvider>;
|
using T = cte_ref_t<AliasProvider>;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
context << name_of<T>::char_ptr();
|
context << name_of<T>::char_ptr();
|
||||||
return context;
|
return context;
|
||||||
@ -285,7 +285,7 @@ namespace sqlpp
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename AliasProvider>
|
template <typename AliasProvider>
|
||||||
auto cte(const AliasProvider&) -> cte_ref_t<AliasProvider>
|
auto cte(const AliasProvider & /*unused*/) -> cte_ref_t<AliasProvider>
|
||||||
{
|
{
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,8 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database, typename... Parts>
|
template <typename Database, typename... Parts>
|
||||||
auto dynamic_custom_query(const Database&, Parts... parts) -> custom_query_t<Database, wrap_operand_t<Parts>...>
|
auto dynamic_custom_query(const Database& /*unused*/, Parts... parts)
|
||||||
|
-> custom_query_t<Database, wrap_operand_t<Parts>...>
|
||||||
{
|
{
|
||||||
static_assert(sizeof...(Parts) > 0, "custom query requires at least one query argument");
|
static_assert(sizeof...(Parts) > 0, "custom query requires at least one query argument");
|
||||||
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter");
|
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter");
|
||||||
|
@ -37,12 +37,12 @@ namespace sqlpp
|
|||||||
struct result_field_t<Db, field_spec_t<NameType, no_value_t, CanBeNull, NullIsTrivialValue>>
|
struct result_field_t<Db, field_spec_t<NameType, no_value_t, CanBeNull, NullIsTrivialValue>>
|
||||||
{
|
{
|
||||||
template <typename Target>
|
template <typename Target>
|
||||||
void _bind(Target&, size_t)
|
void _bind(Target& /*unused*/, size_t /*unused*/)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Target>
|
template <typename Target>
|
||||||
void _post_bind(Target&, size_t)
|
void _post_bind(Target& /*unused*/, size_t /*unused*/)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,7 +62,8 @@ namespace sqlpp
|
|||||||
|
|
||||||
template <typename Db, typename NameType, bool CanBeNull, bool NullIsTrivialValue>
|
template <typename Db, typename NameType, bool CanBeNull, bool NullIsTrivialValue>
|
||||||
inline std::ostream& operator<<(
|
inline std::ostream& operator<<(
|
||||||
std::ostream& os, const result_field_t<Db, field_spec_t<NameType, no_value_t, CanBeNull, NullIsTrivialValue>>&)
|
std::ostream& os,
|
||||||
|
const result_field_t<Db, field_spec_t<NameType, no_value_t, CanBeNull, NullIsTrivialValue>>& /*unused*/)
|
||||||
{
|
{
|
||||||
os << "NULL";
|
os << "NULL";
|
||||||
return os;
|
return os;
|
||||||
|
@ -48,7 +48,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using Operand = default_value_t;
|
using Operand = default_value_t;
|
||||||
|
|
||||||
static Context& _(const Operand&, Context& context)
|
static Context& _(const Operand& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
context << "DEFAULT";
|
context << "DEFAULT";
|
||||||
return context;
|
return context;
|
||||||
|
@ -49,7 +49,7 @@ namespace sqlpp
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
struct as_column_tuple<all_of_t<T>>
|
struct as_column_tuple<all_of_t<T>>
|
||||||
{
|
{
|
||||||
static typename all_of_t<T>::_column_tuple_t _(all_of_t<T>)
|
static typename all_of_t<T>::_column_tuple_t _(all_of_t<T> /*unused*/)
|
||||||
{
|
{
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@ -34,13 +34,13 @@ namespace sqlpp
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template <typename Target, typename Statement, typename Term>
|
template <typename Target, typename Statement, typename Term>
|
||||||
typename Target::_data_t pick_arg_impl(Statement /* statement */, Term term, const std::true_type&)
|
typename Target::_data_t pick_arg_impl(Statement /* statement */, Term term, const std::true_type& /*unused*/)
|
||||||
{
|
{
|
||||||
return term;
|
return term;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Target, typename Statement, typename Term>
|
template <typename Target, typename Statement, typename Term>
|
||||||
typename Target::_data_t pick_arg_impl(Statement statement, Term /* term */, const std::false_type&)
|
typename Target::_data_t pick_arg_impl(Statement statement, Term /* term */, const std::false_type& /*unused*/)
|
||||||
{
|
{
|
||||||
return Target::_get_member(statement)._data;
|
return Target::_get_member(statement)._data;
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
using T = dynamic_select_column_list<void>;
|
using T = dynamic_select_column_list<void>;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = serialize_check_of<Context>;
|
using _serialize_check = serialize_check_of<Context>;
|
||||||
using T = for_update_data_t;
|
using T = for_update_data_t;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
context << " FOR UPDATE ";
|
context << " FOR UPDATE ";
|
||||||
return context;
|
return context;
|
||||||
|
@ -125,7 +125,7 @@ namespace sqlpp
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename DynamicJoin>
|
template <typename DynamicJoin>
|
||||||
auto _add_impl(DynamicJoin dynamicJoin, consistent_t) -> void
|
auto _add_impl(DynamicJoin dynamicJoin, consistent_t /*unused*/) -> void
|
||||||
{
|
{
|
||||||
_data._dynamic_tables.emplace_back(from_table(dynamicJoin));
|
_data._dynamic_tables.emplace_back(from_table(dynamicJoin));
|
||||||
}
|
}
|
||||||
@ -279,7 +279,7 @@ namespace sqlpp
|
|||||||
auto _from_impl(Check, Table table) const -> inconsistent<Check>;
|
auto _from_impl(Check, Table table) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename Database, typename Table>
|
template <typename Database, typename Table>
|
||||||
auto _from_impl(consistent_t, Table table) const
|
auto _from_impl(consistent_t /*unused*/, Table table) const
|
||||||
-> _new_statement_t<consistent_t, from_t<Database, from_table_t<Table>>>
|
-> _new_statement_t<consistent_t, from_t<Database, from_table_t<Table>>>
|
||||||
{
|
{
|
||||||
return {static_cast<const derived_statement_t<Policies>&>(*this),
|
return {static_cast<const derived_statement_t<Policies>&>(*this),
|
||||||
@ -314,7 +314,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database, typename T>
|
template <typename Database, typename T>
|
||||||
auto dynamic_from(const Database&, T&& t)
|
auto dynamic_from(const Database& /*unused*/, T&& t)
|
||||||
-> decltype(statement_t<Database, no_from_t>().dynamic_from(std::forward<T>(t)))
|
-> decltype(statement_t<Database, no_from_t>().dynamic_from(std::forward<T>(t)))
|
||||||
{
|
{
|
||||||
return statement_t<Database, no_from_t>().dynamic_from(std::forward<T>(t));
|
return statement_t<Database, no_from_t>().dynamic_from(std::forward<T>(t));
|
||||||
|
@ -128,7 +128,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
constexpr const char* get_sql_name(const T&)
|
constexpr const char* get_sql_name(const T& /*unused*/)
|
||||||
{
|
{
|
||||||
return name_of<T>::char_ptr();
|
return name_of<T>::char_ptr();
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ namespace sqlpp
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename Expression>
|
template <typename Expression>
|
||||||
void _add_impl(Expression expression, const std::true_type&)
|
void _add_impl(Expression expression, const std::true_type& /*unused*/)
|
||||||
{
|
{
|
||||||
return _data._dynamic_expressions.emplace_back(expression);
|
return _data._dynamic_expressions.emplace_back(expression);
|
||||||
}
|
}
|
||||||
@ -238,7 +238,7 @@ namespace sqlpp
|
|||||||
auto _group_by_impl(Check, Expressions... expressions) const -> inconsistent<Check>;
|
auto _group_by_impl(Check, Expressions... expressions) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename Database, typename... Expressions>
|
template <typename Database, typename... Expressions>
|
||||||
auto _group_by_impl(consistent_t, Expressions... expressions) const
|
auto _group_by_impl(consistent_t /*unused*/, Expressions... expressions) const
|
||||||
-> _new_statement_t<consistent_t, group_by_t<Database, Expressions...>>
|
-> _new_statement_t<consistent_t, group_by_t<Database, Expressions...>>
|
||||||
{
|
{
|
||||||
static_assert(not detail::has_duplicates<Expressions...>::value,
|
static_assert(not detail::has_duplicates<Expressions...>::value,
|
||||||
@ -277,7 +277,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database, typename... T>
|
template <typename Database, typename... T>
|
||||||
auto dynamic_group_by(const Database&, T&&... t)
|
auto dynamic_group_by(const Database& /*unused*/, T&&... t)
|
||||||
-> decltype(statement_t<Database, no_group_by_t>().dynamic_group_by(std::forward<T>(t)...))
|
-> decltype(statement_t<Database, no_group_by_t>().dynamic_group_by(std::forward<T>(t)...))
|
||||||
{
|
{
|
||||||
return statement_t<Database, no_group_by_t>().dynamic_group_by(std::forward<T>(t)...);
|
return statement_t<Database, no_group_by_t>().dynamic_group_by(std::forward<T>(t)...);
|
||||||
|
@ -101,7 +101,7 @@ namespace sqlpp
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename Expr>
|
template <typename Expr>
|
||||||
void _add_impl(Expr expression, const std::true_type&)
|
void _add_impl(Expr expression, const std::true_type& /*unused*/)
|
||||||
{
|
{
|
||||||
return _data._dynamic_expressions.emplace_back(expression);
|
return _data._dynamic_expressions.emplace_back(expression);
|
||||||
}
|
}
|
||||||
@ -281,7 +281,7 @@ namespace sqlpp
|
|||||||
auto _having_impl(Check, Expression expression) const -> inconsistent<Check>;
|
auto _having_impl(Check, Expression expression) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename Database, typename Expression>
|
template <typename Database, typename Expression>
|
||||||
auto _having_impl(consistent_t, Expression expression) const
|
auto _having_impl(consistent_t /*unused*/, Expression expression) const
|
||||||
-> _new_statement_t<consistent_t, having_t<Database, Expression>>
|
-> _new_statement_t<consistent_t, having_t<Database, Expression>>
|
||||||
{
|
{
|
||||||
return {static_cast<const derived_statement_t<Policies>&>(*this),
|
return {static_cast<const derived_statement_t<Policies>&>(*this),
|
||||||
@ -315,7 +315,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database, typename T>
|
template <typename Database, typename T>
|
||||||
auto dynamic_having(const Database&, T&& t)
|
auto dynamic_having(const Database& /*unused*/, T&& t)
|
||||||
-> decltype(statement_t<Database, no_having_t>().dynamic_having(std::forward<T>(t)))
|
-> decltype(statement_t<Database, no_having_t>().dynamic_having(std::forward<T>(t)))
|
||||||
{
|
{
|
||||||
return statement_t<Database, no_having_t>().dynamic_having(std::forward<T>(t));
|
return statement_t<Database, no_having_t>().dynamic_having(std::forward<T>(t));
|
||||||
|
@ -51,7 +51,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using T = hidden_t<Clause>;
|
using T = hidden_t<Clause>;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using T = in_t<Operand>;
|
using T = in_t<Operand>;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
serialize(boolean_operand{false}, context);
|
serialize(boolean_operand{false}, context);
|
||||||
return context;
|
return context;
|
||||||
|
@ -94,7 +94,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using T = insert_name_t;
|
using T = insert_name_t;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
context << "INSERT";
|
context << "INSERT";
|
||||||
|
|
||||||
@ -117,14 +117,15 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database>
|
template <typename Database>
|
||||||
constexpr auto dynamic_insert(const Database&) -> decltype(blank_insert_t<Database>())
|
constexpr auto dynamic_insert(const Database & /*unused*/) -> decltype(blank_insert_t<Database>())
|
||||||
{
|
{
|
||||||
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter");
|
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter");
|
||||||
return {blank_insert_t<Database>()};
|
return {blank_insert_t<Database>()};
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database, typename Table>
|
template <typename Database, typename Table>
|
||||||
constexpr auto dynamic_insert_into(const Database&, Table table) -> decltype(blank_insert_t<Database>().into(table))
|
constexpr auto dynamic_insert_into(const Database& /*unused*/, Table table)
|
||||||
|
-> decltype(blank_insert_t<Database>().into(table))
|
||||||
{
|
{
|
||||||
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter");
|
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter");
|
||||||
return {blank_insert_t<Database>().into(table)};
|
return {blank_insert_t<Database>().into(table)};
|
||||||
|
@ -75,11 +75,12 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
insert_value_t(const rhs_wrap_t<null_t, _trivial_value_is_null>&) : _is_null(true), _is_default(false), _value{}
|
insert_value_t(const rhs_wrap_t<null_t, _trivial_value_is_null>& /*unused*/)
|
||||||
|
: _is_null(true), _is_default(false), _value{}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
insert_value_t(const rhs_wrap_t<default_value_t, _trivial_value_is_null>&)
|
insert_value_t(const rhs_wrap_t<default_value_t, _trivial_value_is_null>& /*unused*/)
|
||||||
: _is_null(false), _is_default(true), _value{}
|
: _is_null(false), _is_default(true), _value{}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -271,7 +271,7 @@ namespace sqlpp
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename Assignment>
|
template <typename Assignment>
|
||||||
void _add_impl(Assignment assignment, const std::true_type&)
|
void _add_impl(Assignment assignment, const std::true_type& /*unused*/)
|
||||||
{
|
{
|
||||||
_data._dynamic_columns.emplace_back(simple_column_t<lhs_t<Assignment>>{assignment._lhs});
|
_data._dynamic_columns.emplace_back(simple_column_t<lhs_t<Assignment>>{assignment._lhs});
|
||||||
_data._dynamic_values.emplace_back(assignment._rhs);
|
_data._dynamic_values.emplace_back(assignment._rhs);
|
||||||
@ -377,7 +377,7 @@ namespace sqlpp
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename... Assignments>
|
template <typename... Assignments>
|
||||||
void _add_impl(const std::true_type&, Assignments... assignments)
|
void _add_impl(const std::true_type& /*unused*/, Assignments... assignments)
|
||||||
{
|
{
|
||||||
return _data._insert_values.emplace_back(insert_value_t<lhs_t<Assignments>>{assignments._rhs}...);
|
return _data._insert_values.emplace_back(insert_value_t<lhs_t<Assignments>>{assignments._rhs}...);
|
||||||
}
|
}
|
||||||
@ -528,7 +528,7 @@ namespace sqlpp
|
|||||||
auto _columns_impl(Check, Columns... cols) const -> inconsistent<Check>;
|
auto _columns_impl(Check, Columns... cols) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename... Columns>
|
template <typename... Columns>
|
||||||
auto _columns_impl(consistent_t, Columns... cols) const
|
auto _columns_impl(consistent_t /*unused*/, Columns... cols) const
|
||||||
-> _new_statement_t<consistent_t, column_list_t<Columns...>>
|
-> _new_statement_t<consistent_t, column_list_t<Columns...>>
|
||||||
{
|
{
|
||||||
static_assert(not detail::has_duplicates<Columns...>::value,
|
static_assert(not detail::has_duplicates<Columns...>::value,
|
||||||
@ -548,7 +548,7 @@ namespace sqlpp
|
|||||||
auto _set_impl(Check, Assignments... assignments) const -> inconsistent<Check>;
|
auto _set_impl(Check, Assignments... assignments) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename Database, typename... Assignments>
|
template <typename Database, typename... Assignments>
|
||||||
auto _set_impl(consistent_t, Assignments... assignments) const
|
auto _set_impl(consistent_t /*unused*/, Assignments... assignments) const
|
||||||
-> _new_statement_t<consistent_t, insert_list_t<Database, Assignments...>>
|
-> _new_statement_t<consistent_t, insert_list_t<Database, Assignments...>>
|
||||||
{
|
{
|
||||||
return {static_cast<const derived_statement_t<Policies>&>(*this),
|
return {static_cast<const derived_statement_t<Policies>&>(*this),
|
||||||
@ -564,7 +564,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using T = insert_default_values_data_t;
|
using T = insert_default_values_data_t;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
context << " DEFAULT VALUES";
|
context << " DEFAULT VALUES";
|
||||||
return context;
|
return context;
|
||||||
|
@ -36,7 +36,7 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
template <typename Element, typename Separator, typename Context, typename UseBraces>
|
template <typename Element, typename Separator, typename Context, typename UseBraces>
|
||||||
static void interpret_tuple_element(
|
static void interpret_tuple_element(
|
||||||
const Element& element, const Separator& separator, Context& context, const UseBraces&, size_t index)
|
const Element& element, const Separator& separator, Context& context, const UseBraces& /*unused*/, size_t index)
|
||||||
{
|
{
|
||||||
if (index)
|
if (index)
|
||||||
context << separator;
|
context << separator;
|
||||||
@ -51,7 +51,8 @@ namespace sqlpp
|
|||||||
const Separator& separator,
|
const Separator& separator,
|
||||||
Context& context,
|
Context& context,
|
||||||
const UseBraces& useBraces,
|
const UseBraces& useBraces,
|
||||||
const detail::index_sequence<Is...>&) -> Context&
|
const detail::index_sequence<Is...> &
|
||||||
|
/*unused*/) -> Context&
|
||||||
{
|
{
|
||||||
// Note: A braced-init-list does guarantee the order of evaluation according to 12.6.1 [class.explicit.init]
|
// Note: A braced-init-list does guarantee the order of evaluation according to 12.6.1 [class.explicit.init]
|
||||||
// paragraph 2 and 8.5.4 [dcl.init.list] paragraph 4.
|
// paragraph 2 and 8.5.4 [dcl.init.list] paragraph 4.
|
||||||
|
@ -96,7 +96,7 @@ namespace sqlpp
|
|||||||
using T = interpretable_list_t<void>;
|
using T = interpretable_list_t<void>;
|
||||||
|
|
||||||
template <typename Separator>
|
template <typename Separator>
|
||||||
static Context& _(const T&, const Separator& /* separator */, Context& context)
|
static Context& _(const T& /*unused*/, const Separator& /* separator */, Context& context)
|
||||||
{
|
{
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ namespace sqlpp
|
|||||||
template <typename Context, typename T, typename Enable = void>
|
template <typename Context, typename T, typename Enable = void>
|
||||||
struct interpreter_t
|
struct interpreter_t
|
||||||
{
|
{
|
||||||
static void _(const T&, Context&)
|
static void _(const T& /*unused*/, Context& /*unused*/)
|
||||||
{
|
{
|
||||||
static_assert(wrong_t<interpreter_t>::value, "missing interpreter specialization");
|
static_assert(wrong_t<interpreter_t>::value, "missing interpreter specialization");
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,8 @@ namespace sqlpp
|
|||||||
auto _into_impl(Check, Table table) const -> inconsistent<Check>;
|
auto _into_impl(Check, Table table) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename Database, typename Table>
|
template <typename Database, typename Table>
|
||||||
auto _into_impl(consistent_t, Table table) const -> _new_statement_t<consistent_t, into_t<Database, Table>>
|
auto _into_impl(consistent_t /*unused*/, Table table) const
|
||||||
|
-> _new_statement_t<consistent_t, into_t<Database, Table>>
|
||||||
{
|
{
|
||||||
static_assert(required_tables_of<into_t<Database, Table>>::size::value == 0,
|
static_assert(required_tables_of<into_t<Database, Table>>::size::value == 0,
|
||||||
"argument depends on another table in into()");
|
"argument depends on another table in into()");
|
||||||
|
@ -278,7 +278,7 @@ namespace sqlpp
|
|||||||
auto _limit_impl(Check, Arg arg) const -> inconsistent<Check>;
|
auto _limit_impl(Check, Arg arg) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename Arg>
|
template <typename Arg>
|
||||||
auto _limit_impl(consistent_t, Arg arg) const -> _new_statement_t<consistent_t, limit_t<Arg>>
|
auto _limit_impl(consistent_t /*unused*/, Arg arg) const -> _new_statement_t<consistent_t, limit_t<Arg>>
|
||||||
{
|
{
|
||||||
return {static_cast<const derived_statement_t<Policies>&>(*this), limit_data_t<Arg>{arg}};
|
return {static_cast<const derived_statement_t<Policies>&>(*this), limit_data_t<Arg>{arg}};
|
||||||
}
|
}
|
||||||
@ -324,7 +324,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database>
|
template <typename Database>
|
||||||
auto dynamic_limit(const Database&) -> decltype(statement_t<Database, no_limit_t>().dynamic_limit())
|
auto dynamic_limit(const Database & /*unused*/) -> decltype(statement_t<Database, no_limit_t>().dynamic_limit())
|
||||||
{
|
{
|
||||||
return statement_t<Database, no_limit_t>().dynamic_limit();
|
return statement_t<Database, no_limit_t>().dynamic_limit();
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ namespace sqlpp
|
|||||||
~multi_column_t() = default;
|
~multi_column_t() = default;
|
||||||
|
|
||||||
template <typename AliasProvider>
|
template <typename AliasProvider>
|
||||||
multi_column_alias_t<AliasProvider, Columns...> as(const AliasProvider&)
|
multi_column_alias_t<AliasProvider, Columns...> as(const AliasProvider& /*unused*/)
|
||||||
{
|
{
|
||||||
return {*this};
|
return {*this};
|
||||||
}
|
}
|
||||||
@ -109,7 +109,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = serialize_check_of<Context, Columns...>;
|
using _serialize_check = serialize_check_of<Context, Columns...>;
|
||||||
using T = multi_column_t<void, Columns...>;
|
using T = multi_column_t<void, Columns...>;
|
||||||
|
|
||||||
static void _(const T&, Context&)
|
static void _(const T& /*unused*/, Context& /*unused*/)
|
||||||
{
|
{
|
||||||
static_assert(wrong_t<serializer_t>::value, "multi_column must be used with an alias");
|
static_assert(wrong_t<serializer_t>::value, "multi_column must be used with an alias");
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using T = no_data_t;
|
using T = no_data_t;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using T = noop;
|
using T = noop;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using T = not_in_t<Operand>;
|
using T = not_in_t<Operand>;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
serialize(boolean_operand{true}, context);
|
serialize(boolean_operand{true}, context);
|
||||||
return context;
|
return context;
|
||||||
|
@ -43,7 +43,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using Operand = null_t;
|
using Operand = null_t;
|
||||||
|
|
||||||
static Context& _(const Operand&, Context& context)
|
static Context& _(const Operand& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
context << "NULL";
|
context << "NULL";
|
||||||
return context;
|
return context;
|
||||||
|
@ -292,7 +292,7 @@ namespace sqlpp
|
|||||||
auto _offset_impl(Check, Arg arg) const -> inconsistent<Check>;
|
auto _offset_impl(Check, Arg arg) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename Arg>
|
template <typename Arg>
|
||||||
auto _offset_impl(consistent_t, Arg arg) const -> _new_statement_t<consistent_t, offset_t<Arg>>
|
auto _offset_impl(consistent_t /*unused*/, Arg arg) const -> _new_statement_t<consistent_t, offset_t<Arg>>
|
||||||
{
|
{
|
||||||
return {static_cast<const derived_statement_t<Policies>&>(*this), offset_data_t<Arg>{arg}};
|
return {static_cast<const derived_statement_t<Policies>&>(*this), offset_data_t<Arg>{arg}};
|
||||||
}
|
}
|
||||||
@ -338,7 +338,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database>
|
template <typename Database>
|
||||||
auto dynamic_offset(const Database&) -> decltype(statement_t<Database, no_offset_t>().dynamic_offset())
|
auto dynamic_offset(const Database & /*unused*/) -> decltype(statement_t<Database, no_offset_t>().dynamic_offset())
|
||||||
{
|
{
|
||||||
return statement_t<Database, no_offset_t>().dynamic_offset();
|
return statement_t<Database, no_offset_t>().dynamic_offset();
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using T = on_t<unconditional_t>;
|
using T = on_t<unconditional_t>;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ namespace sqlpp
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename Expression>
|
template <typename Expression>
|
||||||
void _add_impl(Expression expression, const std::true_type&)
|
void _add_impl(Expression expression, const std::true_type& /*unused*/)
|
||||||
{
|
{
|
||||||
return _data._dynamic_expressions.emplace_back(expression);
|
return _data._dynamic_expressions.emplace_back(expression);
|
||||||
}
|
}
|
||||||
@ -236,7 +236,7 @@ namespace sqlpp
|
|||||||
auto _order_by_impl(Check, Expressions... expressions) const -> inconsistent<Check>;
|
auto _order_by_impl(Check, Expressions... expressions) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename Database, typename... Expressions>
|
template <typename Database, typename... Expressions>
|
||||||
auto _order_by_impl(consistent_t, Expressions... expressions) const
|
auto _order_by_impl(consistent_t /*unused*/, Expressions... expressions) const
|
||||||
-> _new_statement_t<consistent_t, order_by_t<Database, Expressions...>>
|
-> _new_statement_t<consistent_t, order_by_t<Database, Expressions...>>
|
||||||
{
|
{
|
||||||
static_assert(not detail::has_duplicates<Expressions...>::value,
|
static_assert(not detail::has_duplicates<Expressions...>::value,
|
||||||
@ -275,7 +275,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database, typename... T>
|
template <typename Database, typename... T>
|
||||||
auto dynamic_order_by(const Database&, T&&... t)
|
auto dynamic_order_by(const Database& /*unused*/, T&&... t)
|
||||||
-> decltype(statement_t<Database, no_order_by_t>().dynamic_order_by(std::forward<T>(t)...))
|
-> decltype(statement_t<Database, no_order_by_t>().dynamic_order_by(std::forward<T>(t)...))
|
||||||
{
|
{
|
||||||
return statement_t<Database, no_order_by_t>().dynamic_order_by(std::forward<T>(t)...);
|
return statement_t<Database, no_order_by_t>().dynamic_order_by(std::forward<T>(t)...);
|
||||||
|
@ -63,7 +63,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using T = parameter_t<ValueType, NameType>;
|
using T = parameter_t<ValueType, NameType>;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
context << "?";
|
context << "?";
|
||||||
return context;
|
return context;
|
||||||
@ -71,14 +71,15 @@ namespace sqlpp
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename NamedExpr>
|
template <typename NamedExpr>
|
||||||
auto parameter(const NamedExpr&) -> parameter_t<value_type_of<NamedExpr>, NamedExpr>
|
auto parameter(const NamedExpr & /*unused*/) -> parameter_t<value_type_of<NamedExpr>, NamedExpr>
|
||||||
{
|
{
|
||||||
static_assert(is_selectable_t<NamedExpr>::value, "not a named expression");
|
static_assert(is_selectable_t<NamedExpr>::value, "not a named expression");
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename ValueType, typename AliasProvider>
|
template <typename ValueType, typename AliasProvider>
|
||||||
auto parameter(const ValueType&, const AliasProvider&) -> parameter_t<wrap_operand_t<ValueType>, AliasProvider>
|
auto parameter(const ValueType& /*unused*/, const AliasProvider & /*unused*/)
|
||||||
|
-> parameter_t<wrap_operand_t<ValueType>, AliasProvider>
|
||||||
{
|
{
|
||||||
static_assert(is_value_type_t<ValueType>::value, "first argument is not a value type");
|
static_assert(is_value_type_t<ValueType>::value, "first argument is not a value type");
|
||||||
static_assert(is_alias_provider_t<AliasProvider>::value, "second argument is not an alias provider");
|
static_assert(is_alias_provider_t<AliasProvider>::value, "second argument is not an alias provider");
|
||||||
|
@ -58,7 +58,7 @@ namespace sqlpp
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename Target, size_t... Is>
|
template <typename Target, size_t... Is>
|
||||||
void _bind_impl(Target& target, const detail::index_sequence<Is...>&) const
|
void _bind_impl(Target& target, const detail::index_sequence<Is...>& /*unused*/) const
|
||||||
{
|
{
|
||||||
using swallow = int[]; // see interpret_tuple.h
|
using swallow = int[]; // see interpret_tuple.h
|
||||||
(void)swallow{0, (std::tuple_element<Is, _member_tuple_t>::type::operator()()._bind(target, Is), 0)...};
|
(void)swallow{0, (std::tuple_element<Is, _member_tuple_t>::type::operator()()._bind(target, Is), 0)...};
|
||||||
|
@ -122,7 +122,7 @@ namespace sqlpp
|
|||||||
auto on_impl(Check, const Expr&) const -> inconsistent<Check>;
|
auto on_impl(Check, const Expr&) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename Expr>
|
template <typename Expr>
|
||||||
auto on_impl(consistent_t, const Expr& expr) const -> join_t<pre_join_t, on_t<Expr>>
|
auto on_impl(consistent_t /*unused*/, const Expr& expr) const -> join_t<pre_join_t, on_t<Expr>>
|
||||||
{
|
{
|
||||||
return {*this, {expr}};
|
return {*this, {expr}};
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using T = remove_name_t;
|
using T = remove_name_t;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
context << "DELETE";
|
context << "DELETE";
|
||||||
|
|
||||||
@ -116,14 +116,14 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database>
|
template <typename Database>
|
||||||
auto dynamic_remove(const Database&) -> decltype(blank_remove_t<Database>())
|
auto dynamic_remove(const Database & /*unused*/) -> decltype(blank_remove_t<Database>())
|
||||||
{
|
{
|
||||||
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter");
|
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter");
|
||||||
return {blank_remove_t<Database>()};
|
return {blank_remove_t<Database>()};
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database, typename Table>
|
template <typename Database, typename Table>
|
||||||
auto dynamic_remove_from(const Database&, Table table) -> decltype(blank_remove_t<Database>().from(table))
|
auto dynamic_remove_from(const Database& /*unused*/, Table table) -> decltype(blank_remove_t<Database>().from(table))
|
||||||
{
|
{
|
||||||
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter");
|
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter");
|
||||||
return {blank_remove_t<Database>().from(table)};
|
return {blank_remove_t<Database>().from(table)};
|
||||||
|
@ -190,7 +190,7 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
result_row_t(const typename dynamic_select_column_list<void>::_names_t&) : _impl(), _is_valid(false)
|
result_row_t(const typename dynamic_select_column_list<void>::_names_t& /*unused*/) : _impl(), _is_valid(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ namespace sqlpp
|
|||||||
template <typename Expr, typename Enable = void>
|
template <typename Expr, typename Enable = void>
|
||||||
struct rhs_is_trivial_t
|
struct rhs_is_trivial_t
|
||||||
{
|
{
|
||||||
static constexpr bool _(const Expr&)
|
static constexpr bool _(const Expr& /*unused*/)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ namespace sqlpp
|
|||||||
template <typename Expr, typename Enable = void>
|
template <typename Expr, typename Enable = void>
|
||||||
struct rhs_is_null_t
|
struct rhs_is_null_t
|
||||||
{
|
{
|
||||||
static constexpr bool _(const Expr&)
|
static constexpr bool _(const Expr& /*unused*/)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ namespace sqlpp
|
|||||||
|
|
||||||
template <typename AliasProvider>
|
template <typename AliasProvider>
|
||||||
typename Table::template _foreign_table_alias_t<AliasProvider, schema_qualified_table_t> as(
|
typename Table::template _foreign_table_alias_t<AliasProvider, schema_qualified_table_t> as(
|
||||||
const AliasProvider&) const
|
const AliasProvider& /*unused*/) const
|
||||||
{
|
{
|
||||||
return {*this};
|
return {*this};
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using T = select_name_t;
|
using T = select_name_t;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
context << "SELECT ";
|
context << "SELECT ";
|
||||||
|
|
||||||
@ -98,14 +98,15 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database>
|
template <typename Database>
|
||||||
blank_select_t<Database> dynamic_select(const Database&)
|
blank_select_t<Database> dynamic_select(const Database& /*unused*/)
|
||||||
{
|
{
|
||||||
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter");
|
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter");
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database, typename... Columns>
|
template <typename Database, typename... Columns>
|
||||||
auto dynamic_select(const Database&, Columns... columns) -> decltype(blank_select_t<Database>().columns(columns...))
|
auto dynamic_select(const Database& /*unused*/, Columns... columns)
|
||||||
|
-> decltype(blank_select_t<Database>().columns(columns...))
|
||||||
{
|
{
|
||||||
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter");
|
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter");
|
||||||
return blank_select_t<Database>().columns(columns...);
|
return blank_select_t<Database>().columns(columns...);
|
||||||
|
@ -145,7 +145,7 @@ namespace sqlpp
|
|||||||
|
|
||||||
// private:
|
// private:
|
||||||
template <typename NamedExpression>
|
template <typename NamedExpression>
|
||||||
void _add_impl(NamedExpression namedExpression, const std::true_type&)
|
void _add_impl(NamedExpression namedExpression, const std::true_type& /*unused*/)
|
||||||
{
|
{
|
||||||
return _data._dynamic_columns.emplace_back(auto_alias_t<NamedExpression>{namedExpression});
|
return _data._dynamic_columns.emplace_back(auto_alias_t<NamedExpression>{namedExpression});
|
||||||
}
|
}
|
||||||
@ -368,7 +368,7 @@ namespace sqlpp
|
|||||||
using _database_t = typename Policies::_database_t;
|
using _database_t = typename Policies::_database_t;
|
||||||
|
|
||||||
template <typename... T>
|
template <typename... T>
|
||||||
static constexpr auto _check_tuple(std::tuple<T...>) -> check_selected_columns_t<T...>
|
static constexpr auto _check_tuple(std::tuple<T...> /*unused*/) -> check_selected_columns_t<T...>
|
||||||
{
|
{
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@ -412,7 +412,7 @@ namespace sqlpp
|
|||||||
auto _columns_impl(Check, std::tuple<Args...> args) const -> inconsistent<Check>;
|
auto _columns_impl(Check, std::tuple<Args...> args) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename Database, typename... Args>
|
template <typename Database, typename... Args>
|
||||||
auto _columns_impl(consistent_t, std::tuple<Args...> args) const
|
auto _columns_impl(consistent_t /*unused*/, std::tuple<Args...> args) const
|
||||||
-> _new_statement_t<consistent_t, select_column_list_t<Database, Args...>>
|
-> _new_statement_t<consistent_t, select_column_list_t<Database, Args...>>
|
||||||
{
|
{
|
||||||
static_assert(not detail::has_duplicates<Args...>::value, "at least one duplicate argument detected");
|
static_assert(not detail::has_duplicates<Args...>::value, "at least one duplicate argument detected");
|
||||||
@ -449,7 +449,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database, typename... T>
|
template <typename Database, typename... T>
|
||||||
auto dynamic_select_columns(const Database&, T&&... t)
|
auto dynamic_select_columns(const Database& /*unused*/, T&&... t)
|
||||||
-> decltype(statement_t<Database, no_select_column_list_t>().dynamic_columns(std::forward<T>(t)...))
|
-> decltype(statement_t<Database, no_select_column_list_t>().dynamic_columns(std::forward<T>(t)...))
|
||||||
{
|
{
|
||||||
return statement_t<Database, no_select_column_list_t>().dynamic_columns(std::forward<T>(t)...);
|
return statement_t<Database, no_select_column_list_t>().dynamic_columns(std::forward<T>(t)...);
|
||||||
|
@ -94,7 +94,7 @@ namespace sqlpp
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename Flag>
|
template <typename Flag>
|
||||||
void _add_impl(Flag flag, const std::true_type&)
|
void _add_impl(Flag flag, const std::true_type& /*unused*/)
|
||||||
{
|
{
|
||||||
return _data._dynamic_flags.emplace_back(flag);
|
return _data._dynamic_flags.emplace_back(flag);
|
||||||
}
|
}
|
||||||
@ -226,7 +226,7 @@ namespace sqlpp
|
|||||||
auto _flags_impl(Check, Flags... flgs) const -> inconsistent<Check>;
|
auto _flags_impl(Check, Flags... flgs) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename Database, typename... Flags>
|
template <typename Database, typename... Flags>
|
||||||
auto _flags_impl(consistent_t, Flags... flgs) const
|
auto _flags_impl(consistent_t /*unused*/, Flags... flgs) const
|
||||||
-> _new_statement_t<consistent_t, select_flag_list_t<Database, Flags...>>
|
-> _new_statement_t<consistent_t, select_flag_list_t<Database, Flags...>>
|
||||||
{
|
{
|
||||||
static_assert(not detail::has_duplicates<Flags...>::value,
|
static_assert(not detail::has_duplicates<Flags...>::value,
|
||||||
@ -264,7 +264,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database, typename T>
|
template <typename Database, typename T>
|
||||||
auto dynamic_select_flags(const Database&, T&& t)
|
auto dynamic_select_flags(const Database& /*unused*/, T&& t)
|
||||||
-> decltype(statement_t<Database, no_select_flag_list_t>().dynamic_flags(std::forward<T>(t)))
|
-> decltype(statement_t<Database, no_select_flag_list_t>().dynamic_flags(std::forward<T>(t)))
|
||||||
{
|
{
|
||||||
return statement_t<Database, no_select_flag_list_t>().dynamic_flags(std::forward<T>(t));
|
return statement_t<Database, no_select_flag_list_t>().dynamic_flags(std::forward<T>(t));
|
||||||
|
@ -47,7 +47,7 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
|
|
||||||
static Context& _(const all_t&, Context& context)
|
static Context& _(const all_t& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
context << "ALL";
|
context << "ALL";
|
||||||
return context;
|
return context;
|
||||||
@ -66,7 +66,7 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
|
|
||||||
static Context& _(const distinct_t&, Context& context)
|
static Context& _(const distinct_t& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
context << "DISTINCT";
|
context << "DISTINCT";
|
||||||
return context;
|
return context;
|
||||||
@ -85,7 +85,7 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
|
|
||||||
static Context& _(const straight_join_t&, Context& context)
|
static Context& _(const straight_join_t& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
context << "STRAIGHT_JOIN";
|
context << "STRAIGHT_JOIN";
|
||||||
return context;
|
return context;
|
||||||
|
@ -39,7 +39,7 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
using _serialize_check = assert_serializer_specialization_t;
|
using _serialize_check = assert_serializer_specialization_t;
|
||||||
|
|
||||||
static void _(const T&, Context&)
|
static void _(const T& /*unused*/, Context& /*unused*/)
|
||||||
{
|
{
|
||||||
_serialize_check{};
|
_serialize_check{};
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = serialize_check_of<Context, Column>;
|
using _serialize_check = serialize_check_of<Context, Column>;
|
||||||
using T = simple_column_t<Column>;
|
using T = simple_column_t<Column>;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
context << name_of<typename T::_column_t>::char_ptr();
|
context << name_of<typename T::_column_t>::char_ptr();
|
||||||
return context;
|
return context;
|
||||||
|
@ -179,7 +179,7 @@ namespace sqlpp
|
|||||||
auto _single_table_impl(Check, Table table) const -> inconsistent<Check>;
|
auto _single_table_impl(Check, Table table) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename Database, typename Table>
|
template <typename Database, typename Table>
|
||||||
auto _single_table_impl(consistent_t, Table table) const
|
auto _single_table_impl(consistent_t /*unused*/, Table table) const
|
||||||
-> _new_statement_t<consistent_t, single_table_t<Database, Table>>
|
-> _new_statement_t<consistent_t, single_table_t<Database, Table>>
|
||||||
{
|
{
|
||||||
static_assert(required_tables_of<single_table_t<Database, Table>>::size::value == 0,
|
static_assert(required_tables_of<single_table_t<Database, Table>>::size::value == 0,
|
||||||
|
@ -92,7 +92,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename AliasProvider>
|
template <typename AliasProvider>
|
||||||
_alias_t<AliasProvider> as(const AliasProvider&) const
|
_alias_t<AliasProvider> as(const AliasProvider& /*unused*/) const
|
||||||
{
|
{
|
||||||
return {*static_cast<const Table*>(this)};
|
return {*static_cast<const Table*>(this)};
|
||||||
}
|
}
|
||||||
@ -118,7 +118,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using T = X;
|
using T = X;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
context << name_of<T>::char_ptr();
|
context << name_of<T>::char_ptr();
|
||||||
return context;
|
return context;
|
||||||
|
@ -65,7 +65,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = assert_tvin_with_correct_operator_t;
|
using _serialize_check = assert_tvin_with_correct_operator_t;
|
||||||
using T = tvin_arg_t<Operand>;
|
using T = tvin_arg_t<Operand>;
|
||||||
|
|
||||||
static Context& _(const T&, Context&)
|
static Context& _(const T& /*unused*/, Context& /*unused*/)
|
||||||
{
|
{
|
||||||
_serialize_check{};
|
_serialize_check{};
|
||||||
}
|
}
|
||||||
|
@ -244,7 +244,7 @@ namespace sqlpp
|
|||||||
auto _union_impl(Check, Rhs rhs) const -> inconsistent<Check>;
|
auto _union_impl(Check, Rhs rhs) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename Database, typename Flag, typename Rhs>
|
template <typename Database, typename Flag, typename Rhs>
|
||||||
auto _union_impl(consistent_t, Rhs rhs) const
|
auto _union_impl(consistent_t /*unused*/, Rhs rhs) const
|
||||||
-> _new_statement_t<consistent_t, union_t<Database, Flag, derived_statement_t<Policies>, Rhs>>
|
-> _new_statement_t<consistent_t, union_t<Database, Flag, derived_statement_t<Policies>, Rhs>>
|
||||||
{
|
{
|
||||||
return {blank_union_t{}, union_data_t<Database, Flag, derived_statement_t<Policies>, Rhs>{
|
return {blank_union_t{}, union_data_t<Database, Flag, derived_statement_t<Policies>, Rhs>{
|
||||||
|
@ -46,7 +46,7 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
|
|
||||||
static Context& _(const union_all_t&, Context& context)
|
static Context& _(const union_all_t& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
context << "ALL";
|
context << "ALL";
|
||||||
return context;
|
return context;
|
||||||
@ -64,7 +64,7 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
|
|
||||||
static Context& _(const union_distinct_t&, Context& context)
|
static Context& _(const union_distinct_t& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using T = update_name_t;
|
using T = update_name_t;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
context << "UPDATE ";
|
context << "UPDATE ";
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database, typename Table>
|
template <typename Database, typename Table>
|
||||||
constexpr auto dynamic_update(const Database&, Table table)
|
constexpr auto dynamic_update(const Database& /*unused*/, Table table)
|
||||||
-> decltype(blank_update_t<Database>().single_table(table))
|
-> decltype(blank_update_t<Database>().single_table(table))
|
||||||
{
|
{
|
||||||
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter");
|
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter");
|
||||||
|
@ -98,7 +98,7 @@ namespace sqlpp
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename Assignment>
|
template <typename Assignment>
|
||||||
void _add_impl(Assignment assignment, const std::true_type&)
|
void _add_impl(Assignment assignment, const std::true_type& /*unused*/)
|
||||||
{
|
{
|
||||||
return _data._dynamic_assignments.emplace_back(assignment);
|
return _data._dynamic_assignments.emplace_back(assignment);
|
||||||
}
|
}
|
||||||
@ -275,7 +275,7 @@ namespace sqlpp
|
|||||||
auto _set_impl(Check, Assignments... assignments) const -> inconsistent<Check>;
|
auto _set_impl(Check, Assignments... assignments) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename Database, typename... Assignments>
|
template <typename Database, typename... Assignments>
|
||||||
auto _set_impl(consistent_t, Assignments... assignments) const
|
auto _set_impl(consistent_t /*unused*/, Assignments... assignments) const
|
||||||
-> _new_statement_t<consistent_t, update_list_t<Database, Assignments...>>
|
-> _new_statement_t<consistent_t, update_list_t<Database, Assignments...>>
|
||||||
{
|
{
|
||||||
return {static_cast<const derived_statement_t<Policies>&>(*this),
|
return {static_cast<const derived_statement_t<Policies>&>(*this),
|
||||||
|
@ -90,7 +90,7 @@ namespace sqlpp
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename Table>
|
template <typename Table>
|
||||||
void _add_impl(Table table, const std::true_type&)
|
void _add_impl(Table table, const std::true_type& /*unused*/)
|
||||||
{
|
{
|
||||||
return _data._dynamic_tables.emplace_back(table);
|
return _data._dynamic_tables.emplace_back(table);
|
||||||
}
|
}
|
||||||
@ -227,7 +227,7 @@ namespace sqlpp
|
|||||||
auto _using_impl(Check, Tables... tables) const -> inconsistent<Check>;
|
auto _using_impl(Check, Tables... tables) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename Database, typename... Tables>
|
template <typename Database, typename... Tables>
|
||||||
auto _using_impl(consistent_t, Tables... tables) const
|
auto _using_impl(consistent_t /*unused*/, Tables... tables) const
|
||||||
-> _new_statement_t<consistent_t, using_t<_database_t, Tables...>>
|
-> _new_statement_t<consistent_t, using_t<_database_t, Tables...>>
|
||||||
{
|
{
|
||||||
static_assert(not detail::has_duplicates<Tables...>::value,
|
static_assert(not detail::has_duplicates<Tables...>::value,
|
||||||
|
@ -44,7 +44,7 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
value_or_null_t(const null_t&) : _value(), _is_null(true)
|
value_or_null_t(const null_t& /*unused*/) : _value(), _is_null(true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ namespace sqlpp
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename Expr>
|
template <typename Expr>
|
||||||
void _add_impl(Expr expression, const std::true_type&)
|
void _add_impl(Expr expression, const std::true_type& /*unused*/)
|
||||||
{
|
{
|
||||||
return _data._dynamic_expressions.emplace_back(expression);
|
return _data._dynamic_expressions.emplace_back(expression);
|
||||||
}
|
}
|
||||||
@ -349,7 +349,7 @@ namespace sqlpp
|
|||||||
auto _where_impl(Check, Expression expression) const -> inconsistent<Check>;
|
auto _where_impl(Check, Expression expression) const -> inconsistent<Check>;
|
||||||
|
|
||||||
template <typename Database, typename Expression>
|
template <typename Database, typename Expression>
|
||||||
auto _where_impl(consistent_t, Expression expression) const
|
auto _where_impl(consistent_t /*unused*/, Expression expression) const
|
||||||
-> _new_statement_t<consistent_t, where_t<Database, Expression>>
|
-> _new_statement_t<consistent_t, where_t<Database, Expression>>
|
||||||
{
|
{
|
||||||
return {static_cast<const derived_statement_t<Policies>&>(*this),
|
return {static_cast<const derived_statement_t<Policies>&>(*this),
|
||||||
@ -382,7 +382,7 @@ namespace sqlpp
|
|||||||
using _serialize_check = consistent_t;
|
using _serialize_check = consistent_t;
|
||||||
using T = where_data_t<void, unconditional_t>;
|
using T = where_data_t<void, unconditional_t>;
|
||||||
|
|
||||||
static Context& _(const T&, Context& context)
|
static Context& _(const T& /*unused*/, Context& context)
|
||||||
{
|
{
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
@ -395,7 +395,7 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Database, typename T>
|
template <typename Database, typename T>
|
||||||
auto dynamic_where(const Database&, T&& t)
|
auto dynamic_where(const Database& /*unused*/, T&& t)
|
||||||
-> decltype(statement_t<Database, no_where_t<false>>().dynamic_where(std::forward<T>(t)))
|
-> decltype(statement_t<Database, no_where_t<false>>().dynamic_where(std::forward<T>(t)))
|
||||||
{
|
{
|
||||||
return statement_t<Database, no_where_t<false>>().dynamic_where(std::forward<T>(t));
|
return statement_t<Database, no_where_t<false>>().dynamic_where(std::forward<T>(t));
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include <sqlpp11/sqlpp11.h>
|
#include <sqlpp11/sqlpp11.h>
|
||||||
|
|
||||||
int Minimalistic(int, char* [])
|
int Minimalistic(int /*unused*/, char* /*unused*/ [])
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user