0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

removed namespace vendor

This commit is contained in:
rbock 2014-06-14 07:43:27 +02:00
parent 060d59125c
commit 09d220541e
80 changed files with 195 additions and 441 deletions

View File

@ -46,8 +46,6 @@ namespace sqlpp
Expression _expression; Expression _expression;
}; };
namespace vendor
{
template<typename Context, typename Expression, typename AliasProvider> template<typename Context, typename Expression, typename AliasProvider>
struct serializer_t<Context, expression_alias_t<Expression, AliasProvider>> struct serializer_t<Context, expression_alias_t<Expression, AliasProvider>>
{ {
@ -63,7 +61,6 @@ namespace sqlpp
} }
}; };
}
} }
#endif #endif

View File

@ -51,8 +51,6 @@ namespace sqlpp
return {}; return {};
} }
namespace vendor
{
template<typename Context, typename Table> template<typename Context, typename Table>
struct serializer_t<Context, all_of_t<Table>> struct serializer_t<Context, all_of_t<Table>>
{ {
@ -63,7 +61,6 @@ namespace sqlpp
static_assert(wrong_t<T>::value, "all_of(table) does not seem to be used in select"); static_assert(wrong_t<T>::value, "all_of(table) does not seem to be used in select");
} }
}; };
}
} }

View File

@ -32,8 +32,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename Select> template<typename Select>
struct any_t struct any_t
{ {
@ -64,14 +62,11 @@ namespace sqlpp
Select _select; Select _select;
}; };
}
namespace vendor
{
template<typename Context, typename Select> template<typename Context, typename Select>
struct serializer_t<Context, vendor::any_t<Select>> struct serializer_t<Context, any_t<Select>>
{ {
using T = vendor::any_t<Select>; using T = any_t<Select>;
static Context& _(const T& t, Context& context) static Context& _(const T& t, Context& context)
{ {
@ -83,15 +78,14 @@ namespace sqlpp
}; };
template<typename T> template<typename T>
auto any(T t) -> typename vendor::any_t<vendor::wrap_operand_t<T>> auto any(T t) -> typename any_t<wrap_operand_t<T>>
{ {
static_assert(is_select_t<vendor::wrap_operand_t<T>>::value, "any() requires a select expression as argument"); static_assert(is_select_t<wrap_operand_t<T>>::value, "any() requires a select expression as argument");
static_assert(is_expression_t<vendor::wrap_operand_t<T>>::value, "any() requires a single column select expression as argument"); static_assert(is_expression_t<wrap_operand_t<T>>::value, "any() requires a single column select expression as argument");
// FIXME: can we accept non-values like NULL here? // FIXME: can we accept non-values like NULL here?
return { t }; return { t };
} }
}
} }
#endif #endif

View File

@ -36,8 +36,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename T, typename Enable = void> template<typename T, typename Enable = void>
struct is_trivial_t struct is_trivial_t
{ {
@ -158,7 +156,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
} }
#endif #endif

View File

@ -31,8 +31,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename Flag, typename Expr> template<typename Flag, typename Expr>
struct avg_t: public floating_point::template expression_operators<avg_t<Flag, Expr>>, struct avg_t: public floating_point::template expression_operators<avg_t<Flag, Expr>>,
public alias_operators<avg_t<Flag, Expr>> public alias_operators<avg_t<Flag, Expr>>
@ -67,14 +65,11 @@ namespace sqlpp
Expr _expr; Expr _expr;
}; };
}
namespace vendor
{
template<typename Context, typename Flag, typename Expr> template<typename Context, typename Flag, typename Expr>
struct serializer_t<Context, vendor::avg_t<Flag, Expr>> struct serializer_t<Context, avg_t<Flag, Expr>>
{ {
using T = vendor::avg_t<Flag, Expr>; using T = avg_t<Flag, Expr>;
static Context& _(const T& t, Context& context) static Context& _(const T& t, Context& context)
{ {
@ -89,19 +84,18 @@ namespace sqlpp
return context; return context;
} }
}; };
}
template<typename T> template<typename T>
auto avg(T t) -> typename vendor::avg_t<vendor::noop, vendor::wrap_operand_t<T>> auto avg(T t) -> typename avg_t<noop, wrap_operand_t<T>>
{ {
static_assert(is_numeric_t<vendor::wrap_operand_t<T>>::value, "avg() requires a value expression as argument"); static_assert(is_numeric_t<wrap_operand_t<T>>::value, "avg() requires a value expression as argument");
return { t }; return { t };
} }
template<typename T> template<typename T>
auto avg(const sqlpp::distinct_t&, T t) -> typename vendor::avg_t<sqlpp::distinct_t, vendor::wrap_operand_t<T>> auto avg(const sqlpp::distinct_t&, T t) -> typename avg_t<sqlpp::distinct_t, wrap_operand_t<T>>
{ {
static_assert(is_numeric_t<vendor::wrap_operand_t<T>>::value, "avg() requires a value expression as argument"); static_assert(is_numeric_t<wrap_operand_t<T>>::value, "avg() requires a value expression as argument");
return { t }; return { t };
} }

View File

@ -52,65 +52,65 @@ namespace sqlpp
}; };
template<typename T> template<typename T>
vendor::equal_to_t<Base, vendor::wrap_operand_t<T>> operator==(T t) const equal_to_t<Base, wrap_operand_t<T>> operator==(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_comparison_operand<rhs>::value, "invalid rhs operand in comparison"); static_assert(_is_valid_comparison_operand<rhs>::value, "invalid rhs operand in comparison");
return { *static_cast<const Base*>(this), rhs{t} }; return { *static_cast<const Base*>(this), rhs{t} };
} }
template<typename T> template<typename T>
vendor::not_equal_to_t<Base, vendor::wrap_operand_t<T>> operator!=(T t) const not_equal_to_t<Base, wrap_operand_t<T>> operator!=(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_comparison_operand<rhs>::value, "invalid rhs operand in comparison"); static_assert(_is_valid_comparison_operand<rhs>::value, "invalid rhs operand in comparison");
return { *static_cast<const Base*>(this), rhs{t} }; return { *static_cast<const Base*>(this), rhs{t} };
} }
template<typename T> template<typename T>
vendor::less_than_t<Base, vendor::wrap_operand_t<T>> operator<(T t) const less_than_t<Base, wrap_operand_t<T>> operator<(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_comparison_operand<rhs>::value, "invalid rhs operand in comparison"); static_assert(_is_valid_comparison_operand<rhs>::value, "invalid rhs operand in comparison");
return { *static_cast<const Base*>(this), rhs{t} }; return { *static_cast<const Base*>(this), rhs{t} };
} }
template<typename T> template<typename T>
vendor::less_equal_t<Base, vendor::wrap_operand_t<T>> operator<=(T t) const less_equal_t<Base, wrap_operand_t<T>> operator<=(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_comparison_operand<rhs>::value, "invalid rhs operand in comparison"); static_assert(_is_valid_comparison_operand<rhs>::value, "invalid rhs operand in comparison");
return { *static_cast<const Base*>(this), rhs{t} }; return { *static_cast<const Base*>(this), rhs{t} };
} }
template<typename T> template<typename T>
vendor::greater_than_t<Base, vendor::wrap_operand_t<T>> operator>(T t) const greater_than_t<Base, wrap_operand_t<T>> operator>(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_comparison_operand<rhs>::value, "invalid rhs operand in comparison"); static_assert(_is_valid_comparison_operand<rhs>::value, "invalid rhs operand in comparison");
return { *static_cast<const Base*>(this), rhs{t} }; return { *static_cast<const Base*>(this), rhs{t} };
} }
template<typename T> template<typename T>
vendor::greater_equal_t<Base, vendor::wrap_operand_t<T>> operator>=(T t) const greater_equal_t<Base, wrap_operand_t<T>> operator>=(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_comparison_operand<rhs>::value, "invalid rhs operand in comparison"); static_assert(_is_valid_comparison_operand<rhs>::value, "invalid rhs operand in comparison");
return { *static_cast<const Base*>(this), rhs{t} }; return { *static_cast<const Base*>(this), rhs{t} };
} }
vendor::is_null_t<true, Base> is_null() const is_null_t<true, Base> is_null() const
{ {
return { *static_cast<const Base*>(this) }; return { *static_cast<const Base*>(this) };
} }
vendor::is_null_t<false, Base> is_not_null() const is_null_t<false, Base> is_not_null() const
{ {
return { *static_cast<const Base*>(this) }; return { *static_cast<const Base*>(this) };
} }
@ -127,17 +127,17 @@ namespace sqlpp
// Hint: use value_list wrapper for containers... // Hint: use value_list wrapper for containers...
template<typename... T> template<typename... T>
vendor::in_t<true, Base, vendor::wrap_operand_t<T>...> in(T... t) const in_t<true, Base, wrap_operand_t<T>...> in(T... t) const
{ {
static_assert(detail::all_t<_is_valid_comparison_operand<vendor::wrap_operand_t<T>>::value...>::value, "at least one operand of in() is not valid"); static_assert(detail::all_t<_is_valid_comparison_operand<wrap_operand_t<T>>::value...>::value, "at least one operand of in() is not valid");
return { *static_cast<const Base*>(this), vendor::wrap_operand_t<T>{t}... }; return { *static_cast<const Base*>(this), wrap_operand_t<T>{t}... };
} }
template<typename... T> template<typename... T>
vendor::in_t<false, Base, vendor::wrap_operand_t<T>...> not_in(T... t) const in_t<false, Base, wrap_operand_t<T>...> not_in(T... t) const
{ {
static_assert(detail::all_t<_is_valid_comparison_operand<vendor::wrap_operand_t<T>>::value...>::value, "at least one operand of in() is not valid"); static_assert(detail::all_t<_is_valid_comparison_operand<wrap_operand_t<T>>::value...>::value, "at least one operand of in() is not valid");
return { *static_cast<const Base*>(this), vendor::wrap_operand_t<T>{t}... }; return { *static_cast<const Base*>(this), wrap_operand_t<T>{t}... };
} }
}; };

View File

@ -184,24 +184,24 @@ namespace sqlpp
struct expression_operators: public basic_expression_operators<Base, is_boolean_t> struct expression_operators: public basic_expression_operators<Base, is_boolean_t>
{ {
template<typename T> template<typename T>
vendor::logical_and_t<Base, vendor::wrap_operand_t<T>> operator and(T t) const logical_and_t<Base, wrap_operand_t<T>> operator and(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand");
return { *static_cast<const Base*>(this), rhs{t} }; return { *static_cast<const Base*>(this), rhs{t} };
} }
template<typename T> template<typename T>
vendor::logical_or_t<Base, vendor::wrap_operand_t<T>> operator or(T t) const logical_or_t<Base, wrap_operand_t<T>> operator or(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand");
return { *static_cast<const Base*>(this), rhs{t} }; return { *static_cast<const Base*>(this), rhs{t} };
} }
vendor::logical_not_t<Base> operator not() const logical_not_t<Base> operator not() const
{ {
return { *static_cast<const Base*>(this) }; return { *static_cast<const Base*>(this) };
} }

View File

@ -81,30 +81,28 @@ namespace sqlpp
} }
template<typename T> template<typename T>
auto operator =(T t) const -> vendor::assignment_t<column_t, vendor::wrap_operand_t<T>> auto operator =(T t) const -> assignment_t<column_t, wrap_operand_t<T>>
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand assignment operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand assignment operand");
return { *this, rhs{t} }; return { *this, rhs{t} };
} }
auto operator =(sqlpp::null_t) const auto operator =(sqlpp::null_t) const
->vendor::assignment_t<column_t, sqlpp::null_t> ->assignment_t<column_t, sqlpp::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, {} }; return { *this, {} };
} }
auto operator =(sqlpp::default_value_t) const auto operator =(sqlpp::default_value_t) const
->vendor::assignment_t<column_t, sqlpp::default_value_t> ->assignment_t<column_t, sqlpp::default_value_t>
{ {
return { *this, {} }; return { *this, {} };
} }
}; };
namespace vendor
{
template<typename Context, typename... Args> template<typename Context, typename... Args>
struct serializer_t<Context, column_t<Args...>> struct serializer_t<Context, column_t<Args...>>
{ {
@ -117,7 +115,6 @@ namespace sqlpp
} }
}; };
}
} }
#endif #endif

View File

@ -33,8 +33,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
// FIXME: Remove First, inherit from text_t // FIXME: Remove First, inherit from text_t
template<typename First, typename... Args> template<typename First, typename... Args>
struct concat_t: public value_type_of<First>::template expression_operators<concat_t<First, Args...>>, struct concat_t: public value_type_of<First>::template expression_operators<concat_t<First, Args...>>,
@ -81,7 +79,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
} }
#endif #endif

View File

@ -32,8 +32,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename Flag, typename Expr> template<typename Flag, typename Expr>
struct count_t: public sqlpp::detail::integral::template expression_operators<count_t<Flag, Expr>>, struct count_t: public sqlpp::detail::integral::template expression_operators<count_t<Flag, Expr>>,
public alias_operators<count_t<Flag, Expr>> public alias_operators<count_t<Flag, Expr>>
@ -68,14 +66,11 @@ namespace sqlpp
Expr _expr; Expr _expr;
}; };
}
namespace vendor
{
template<typename Context, typename Flag, typename Expr> template<typename Context, typename Flag, typename Expr>
struct serializer_t<Context, vendor::count_t<Flag, Expr>> struct serializer_t<Context, count_t<Flag, Expr>>
{ {
using T = vendor::count_t<Flag, Expr>; using T = count_t<Flag, Expr>;
static Context& _(const T& t, Context& context) static Context& _(const T& t, Context& context)
{ {
@ -90,19 +85,18 @@ namespace sqlpp
return context; return context;
} }
}; };
}
template<typename T> template<typename T>
auto count(T t) -> typename vendor::count_t<vendor::noop, vendor::wrap_operand_t<T>> auto count(T t) -> typename count_t<noop, wrap_operand_t<T>>
{ {
static_assert(is_expression_t<vendor::wrap_operand_t<T>>::value, "count() requires an expression as argument"); static_assert(is_expression_t<wrap_operand_t<T>>::value, "count() requires an expression as argument");
return { t }; return { t };
} }
template<typename T> template<typename T>
auto count(const sqlpp::distinct_t&, T t) -> typename vendor::count_t<sqlpp::distinct_t, vendor::wrap_operand_t<T>> auto count(const sqlpp::distinct_t&, T t) -> typename count_t<sqlpp::distinct_t, wrap_operand_t<T>>
{ {
static_assert(is_expression_t<vendor::wrap_operand_t<T>>::value, "count() requires an expression as argument"); static_assert(is_expression_t<wrap_operand_t<T>>::value, "count() requires an expression as argument");
return { t }; return { t };
} }

View File

@ -39,8 +39,6 @@ namespace sqlpp
static constexpr bool _is_trivial() { return false; } static constexpr bool _is_trivial() { return false; }
}; };
namespace vendor
{
template<typename Context> template<typename Context>
struct serializer_t<Context, default_value_t> struct serializer_t<Context, default_value_t>
{ {
@ -52,7 +50,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
constexpr default_value_t default_value = {}; constexpr default_value_t default_value = {};

View File

@ -49,7 +49,7 @@ namespace sqlpp
}; };
template<std::size_t LastIndex, std::size_t... Ints, typename AliasProvider, typename... Fields, typename... Rest> template<std::size_t LastIndex, std::size_t... Ints, typename AliasProvider, typename... Fields, typename... Rest>
struct make_column_index_sequence_impl<column_index_sequence<LastIndex, Ints...>, vendor::multi_field_t<AliasProvider, Fields...>, Rest...> struct make_column_index_sequence_impl<column_index_sequence<LastIndex, Ints...>, multi_field_t<AliasProvider, Fields...>, Rest...>
{ {
using type = typename make_column_index_sequence_impl<column_index_sequence<LastIndex + sizeof...(Fields), Ints..., LastIndex + sizeof...(Fields)>, Rest...>::type; using type = typename make_column_index_sequence_impl<column_index_sequence<LastIndex + sizeof...(Fields), Ints..., LastIndex + sizeof...(Fields)>, Rest...>::type;
}; };

View File

@ -57,7 +57,7 @@ namespace sqlpp
template<template<typename, typename...> class Target, typename First, typename T> template<template<typename, typename...> class Target, typename First, typename T>
struct copy_tuple_args_impl struct copy_tuple_args_impl
{ {
static_assert(vendor::wrong_t<T>::value, "copy_tuple_args must be called with a tuple"); static_assert(wrong_t<T>::value, "copy_tuple_args must be called with a tuple");
}; };
template<template<typename First, typename...> class Target, typename First, typename... Args> template<template<typename First, typename...> class Target, typename First, typename... Args>

View File

@ -73,7 +73,7 @@ namespace sqlpp
template<typename E, typename SET> template<typename E, typename SET>
struct is_element_of struct is_element_of
{ {
static_assert(::sqlpp::vendor::wrong_t<E, SET>::value, "SET has to be a type set"); static_assert(::sqlpp::wrong_t<E, SET>::value, "SET has to be a type set");
}; };
template<typename E, typename... Elements> template<typename E, typename... Elements>
@ -85,7 +85,7 @@ namespace sqlpp
template<typename L, typename R> template<typename L, typename R>
struct joined_set struct joined_set
{ {
static_assert(::sqlpp::vendor::wrong_t<L, R>::value, "L and R have to be type sets"); static_assert(::sqlpp::wrong_t<L, R>::value, "L and R have to be type sets");
}; };
template<typename... LElements, typename... RElements> template<typename... LElements, typename... RElements>
@ -100,7 +100,7 @@ namespace sqlpp
template<typename L, typename R> template<typename L, typename R>
struct is_superset_of struct is_superset_of
{ {
static_assert(::sqlpp::vendor::wrong_t<L, R>::value, "L and R have to be type sets"); static_assert(::sqlpp::wrong_t<L, R>::value, "L and R have to be type sets");
}; };
template<typename... LElements, typename... RElements> template<typename... LElements, typename... RElements>
@ -118,7 +118,7 @@ namespace sqlpp
template<typename L, typename R> template<typename L, typename R>
struct is_disjunct_from struct is_disjunct_from
{ {
static_assert(::sqlpp::vendor::wrong_t<L, R>::value, "invalid argument for is_disjunct_from"); static_assert(::sqlpp::wrong_t<L, R>::value, "invalid argument for is_disjunct_from");
}; };
template<typename... LElements, typename... RElements> template<typename... LElements, typename... RElements>
@ -174,7 +174,7 @@ namespace sqlpp
template<typename... T> template<typename... T>
struct make_joined_set struct make_joined_set
{ {
static_assert(::sqlpp::vendor::wrong_t<T...>::value, "invalid argument for joined set"); static_assert(::sqlpp::wrong_t<T...>::value, "invalid argument for joined set");
}; };
template<> template<>
@ -197,7 +197,7 @@ namespace sqlpp
template<typename Minuend, typename Subtrahend> template<typename Minuend, typename Subtrahend>
struct make_difference_set struct make_difference_set
{ {
static_assert(::sqlpp::vendor::wrong_t<Minuend, Subtrahend>::value, "invalid argument for difference set"); static_assert(::sqlpp::wrong_t<Minuend, Subtrahend>::value, "invalid argument for difference set");
}; };
template<typename... Minuends, typename... Subtrahends> template<typename... Minuends, typename... Subtrahends>

View File

@ -31,8 +31,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename Select> template<typename Select>
struct exists_t: public boolean::template expression_operators<exists_t<Select>>, struct exists_t: public boolean::template expression_operators<exists_t<Select>>,
public alias_operators<exists_t<Select>> public alias_operators<exists_t<Select>>
@ -66,14 +64,11 @@ namespace sqlpp
Select _select; Select _select;
}; };
}
namespace vendor
{
template<typename Context, typename Select> template<typename Context, typename Select>
struct serializer_t<Context, vendor::exists_t<Select>> struct serializer_t<Context, exists_t<Select>>
{ {
using T = vendor::exists_t<Select>; using T = exists_t<Select>;
static Context& _(const T& t, Context& context) static Context& _(const T& t, Context& context)
{ {
@ -83,13 +78,12 @@ namespace sqlpp
return context; return context;
} }
}; };
}
template<typename T> template<typename T>
auto exists(T t) -> typename vendor::exists_t<vendor::wrap_operand_t<T>> auto exists(T t) -> typename exists_t<wrap_operand_t<T>>
{ {
static_assert(is_select_t<vendor::wrap_operand_t<T>>::value, "exists() requires a select expression as argument"); static_assert(is_select_t<wrap_operand_t<T>>::value, "exists() requires a select expression as argument");
return { t }; return { t };
} }

View File

@ -37,8 +37,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename Lhs, typename Rhs> template<typename Lhs, typename Rhs>
struct binary_expression_t<Lhs, op::equal_to, Rhs>: public ::sqlpp::detail::boolean::template expression_operators<binary_expression_t<Lhs, op::equal_to, Rhs>>, struct binary_expression_t<Lhs, op::equal_to, Rhs>: public ::sqlpp::detail::boolean::template expression_operators<binary_expression_t<Lhs, op::equal_to, Rhs>>,
public alias_operators<binary_expression_t<Lhs, op::equal_to, Rhs>> public alias_operators<binary_expression_t<Lhs, op::equal_to, Rhs>>
@ -236,7 +234,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
} }
#endif #endif

View File

@ -36,8 +36,6 @@ namespace sqlpp
struct floating_point; struct floating_point;
} }
namespace vendor
{
namespace op namespace op
{ {
struct less struct less
@ -193,7 +191,6 @@ namespace sqlpp
template<typename ValueType, typename Rhs> template<typename ValueType, typename Rhs>
using unary_minus_t = unary_expression_t<op::unary_minus<ValueType>, Rhs>; using unary_minus_t = unary_expression_t<op::unary_minus<ValueType>, Rhs>;
}
} }
#endif #endif

View File

@ -33,8 +33,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename... Tables> template<typename... Tables>
struct extra_tables_data_t struct extra_tables_data_t
{ {
@ -164,7 +162,6 @@ namespace sqlpp
} }
}; };
}
} }
#endif #endif

View File

@ -31,8 +31,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename NameType, typename ValueType, bool TrivialValueIsNull> template<typename NameType, typename ValueType, bool TrivialValueIsNull>
struct field_t struct field_t
{ {
@ -67,7 +65,6 @@ namespace sqlpp
template<typename NamedExpr> template<typename NamedExpr>
using make_field_t = typename detail::make_field_t_impl<NamedExpr>::type; using make_field_t = typename detail::make_field_t_impl<NamedExpr>::type;
}
} }

View File

@ -185,45 +185,45 @@ namespace sqlpp
struct expression_operators: public basic_expression_operators<Base, is_numeric_t> struct expression_operators: public basic_expression_operators<Base, is_numeric_t>
{ {
template<typename T> template<typename T>
vendor::plus_t<Base, floating_point, vendor::wrap_operand_t<T>> operator +(T t) const plus_t<Base, floating_point, wrap_operand_t<T>> operator +(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand");
return { *static_cast<const Base*>(this), rhs{t} }; return { *static_cast<const Base*>(this), rhs{t} };
} }
template<typename T> template<typename T>
vendor::minus_t<Base, floating_point, vendor::wrap_operand_t<T>> operator -(T t) const minus_t<Base, floating_point, wrap_operand_t<T>> operator -(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand");
return { *static_cast<const Base*>(this), rhs{t} }; return { *static_cast<const Base*>(this), rhs{t} };
} }
template<typename T> template<typename T>
vendor::multiplies_t<Base, floating_point, vendor::wrap_operand_t<T>> operator *(T t) const multiplies_t<Base, floating_point, wrap_operand_t<T>> operator *(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
return { *static_cast<const Base*>(this), rhs{t} }; return { *static_cast<const Base*>(this), rhs{t} };
} }
template<typename T> template<typename T>
vendor::divides_t<Base, vendor::wrap_operand_t<T>> operator /(T t) const divides_t<Base, wrap_operand_t<T>> operator /(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
return { *static_cast<const Base*>(this), rhs{t} }; return { *static_cast<const Base*>(this), rhs{t} };
} }
vendor::unary_plus_t<floating_point, Base> operator +() const unary_plus_t<floating_point, Base> operator +() const
{ {
return { *static_cast<const Base*>(this) }; return { *static_cast<const Base*>(this) };
} }
vendor::unary_minus_t<floating_point, Base> operator -() const unary_minus_t<floating_point, Base> operator -() const
{ {
return { *static_cast<const Base*>(this) }; return { *static_cast<const Base*>(this) };
} }
@ -233,36 +233,36 @@ namespace sqlpp
struct column_operators struct column_operators
{ {
template<typename T> template<typename T>
auto operator +=(T t) const -> vendor::assignment_t<Base, vendor::plus_t<Base, floating_point, vendor::wrap_operand_t<T>>> auto operator +=(T t) const -> assignment_t<Base, plus_t<Base, floating_point, wrap_operand_t<T>>>
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } }; return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } };
} }
template<typename T> template<typename T>
auto operator -=(T t) const -> vendor::assignment_t<Base, vendor::minus_t<Base, floating_point, vendor::wrap_operand_t<T>>> auto operator -=(T t) const -> assignment_t<Base, minus_t<Base, floating_point, wrap_operand_t<T>>>
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } }; return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } };
} }
template<typename T> template<typename T>
auto operator /=(T t) const -> vendor::assignment_t<Base, vendor::divides_t<Base, vendor::wrap_operand_t<T>>> auto operator /=(T t) const -> assignment_t<Base, divides_t<Base, wrap_operand_t<T>>>
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } }; return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } };
} }
template<typename T> template<typename T>
auto operator *=(T t) const -> vendor::assignment_t<Base, vendor::multiplies_t<Base, floating_point, vendor::wrap_operand_t<T>>> auto operator *=(T t) const -> assignment_t<Base, multiplies_t<Base, floating_point, wrap_operand_t<T>>>
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } }; return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } };

View File

@ -35,8 +35,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
// FROM DATA // FROM DATA
template<typename Database, typename... Tables> template<typename Database, typename... Tables>
struct from_data_t struct from_data_t
@ -52,7 +50,7 @@ namespace sqlpp
~from_data_t() = default; ~from_data_t() = default;
std::tuple<Tables...> _tables; std::tuple<Tables...> _tables;
vendor::interpretable_list_t<Database> _dynamic_tables; interpretable_list_t<Database> _dynamic_tables;
}; };
// FROM // FROM
@ -206,7 +204,6 @@ namespace sqlpp
} }
}; };
}
} }
#endif #endif

View File

@ -46,11 +46,11 @@
namespace sqlpp namespace sqlpp
{ {
template<typename T> template<typename T>
auto value(T t) -> vendor::wrap_operand_t<T> auto value(T t) -> wrap_operand_t<T>
{ {
using _provided_tables = detail::type_set<>; using _provided_tables = detail::type_set<>;
using _required_tables = ::sqlpp::detail::type_set<>; using _required_tables = ::sqlpp::detail::type_set<>;
static_assert(is_wrapped_value_t<vendor::wrap_operand_t<T>>::value, "value() is to be called with non-sql-type like int, or string"); static_assert(is_wrapped_value_t<wrap_operand_t<T>>::value, "value() is to be called with non-sql-type like int, or string");
return { t }; return { t };
} }
@ -71,8 +71,6 @@ namespace sqlpp
std::string _verbatim; std::string _verbatim;
}; };
namespace vendor
{
template<typename Context, typename ValueType> template<typename Context, typename ValueType>
struct serializer_t<Context, verbatim_t<ValueType>> struct serializer_t<Context, verbatim_t<ValueType>>
{ {
@ -84,7 +82,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
template<typename ValueType, typename StringType> template<typename ValueType, typename StringType>
auto verbatim(StringType s) -> verbatim_t<ValueType> auto verbatim(StringType s) -> verbatim_t<ValueType>
@ -104,7 +101,7 @@ namespace sqlpp
template<typename Container> template<typename Container>
struct value_list_t // to be used in .in() method struct value_list_t // to be used in .in() method
{ {
using _traits = make_traits<vendor::value_type_t<typename Container::value_type>>; using _traits = make_traits<value_type_t<typename Container::value_type>>;
using _recursive_traits = make_recursive_traits<>; using _recursive_traits = make_recursive_traits<>;
using _container_t = Container; using _container_t = Container;
@ -122,8 +119,6 @@ namespace sqlpp
_container_t _container; _container_t _container;
}; };
namespace vendor
{
template<typename Context, typename Container> template<typename Context, typename Container>
struct serializer_t<Context, value_list_t<Container>> struct serializer_t<Context, value_list_t<Container>>
{ {
@ -144,12 +139,11 @@ namespace sqlpp
return context; return context;
} }
}; };
}
template<typename Container> template<typename Container>
auto value_list(Container c) -> value_list_t<Container> auto value_list(Container c) -> value_list_t<Container>
{ {
static_assert(is_wrapped_value_t<vendor::wrap_operand_t<typename Container::value_type>>::value, "value_list() is to be called with a container of non-sql-type like std::vector<int>, or std::list(string)"); static_assert(is_wrapped_value_t<wrap_operand_t<typename Container::value_type>>::value, "value_list() is to be called with a container of non-sql-type like std::vector<int>, or std::list(string)");
return { c }; return { c };
} }

View File

@ -37,8 +37,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
// GROUP BY DATA // GROUP BY DATA
template<typename Database, typename... Expressions> template<typename Database, typename... Expressions>
struct group_by_data_t struct group_by_data_t
@ -54,7 +52,7 @@ namespace sqlpp
~group_by_data_t() = default; ~group_by_data_t() = default;
std::tuple<Expressions...> _expressions; std::tuple<Expressions...> _expressions;
vendor::interpretable_list_t<Database> _dynamic_expressions; interpretable_list_t<Database> _dynamic_expressions;
}; };
// GROUP BY // GROUP BY
@ -208,7 +206,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
} }
#endif #endif

View File

@ -36,8 +36,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
// HAVING DATA // HAVING DATA
template<typename Database, typename... Expressions> template<typename Database, typename... Expressions>
struct having_data_t struct having_data_t
@ -53,7 +51,7 @@ namespace sqlpp
~having_data_t() = default; ~having_data_t() = default;
std::tuple<Expressions...> _expressions; std::tuple<Expressions...> _expressions;
vendor::interpretable_list_t<Database> _dynamic_expressions; interpretable_list_t<Database> _dynamic_expressions;
}; };
// HAVING // HAVING
@ -206,7 +204,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
} }
#endif #endif

View File

@ -34,8 +34,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<bool NotInverted, typename Operand, typename... Args> template<bool NotInverted, typename Operand, typename... Args>
struct in_t: public boolean::template expression_operators<in_t<NotInverted, Operand, Args...>>, struct in_t: public boolean::template expression_operators<in_t<NotInverted, Operand, Args...>>,
public alias_operators<in_t<NotInverted, Operand, Args...>> public alias_operators<in_t<NotInverted, Operand, Args...>>
@ -72,9 +70,9 @@ namespace sqlpp
}; };
template<typename Context, bool NotInverted, typename Operand, typename... Args> template<typename Context, bool NotInverted, typename Operand, typename... Args>
struct serializer_t<Context, vendor::in_t<NotInverted, Operand, Args...>> struct serializer_t<Context, in_t<NotInverted, Operand, Args...>>
{ {
using T = vendor::in_t<NotInverted, Operand, Args...>; using T = in_t<NotInverted, Operand, Args...>;
static Context& _(const T& t, Context& context) static Context& _(const T& t, Context& context)
{ {
@ -85,7 +83,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
} }

View File

@ -29,11 +29,8 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<bool NotInverted, typename Operand, typename... Args> template<bool NotInverted, typename Operand, typename... Args>
struct in_t; struct in_t;
}
} }

View File

@ -40,11 +40,9 @@ namespace sqlpp
{ {
struct insert_name_t {}; struct insert_name_t {};
struct insert_t: public vendor::statement_name_t<insert_name_t> struct insert_t: public statement_name_t<insert_name_t>
{}; {};
namespace vendor
{
template<typename Context> template<typename Context>
struct serializer_t<Context, insert_name_t> struct serializer_t<Context, insert_name_t>
{ {
@ -57,13 +55,12 @@ namespace sqlpp
return context; return context;
} }
}; };
}
template<typename Database> template<typename Database>
using blank_insert_t = statement_t<Database, using blank_insert_t = statement_t<Database,
insert_t, insert_t,
vendor::no_into_t, no_into_t,
vendor::no_insert_value_list_t>; no_insert_value_list_t>;
auto insert() auto insert()
-> blank_insert_t<void> -> blank_insert_t<void>

View File

@ -36,8 +36,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
namespace detail namespace detail
{ {
template<typename Type, bool> template<typename Type, bool>
@ -118,7 +116,6 @@ namespace sqlpp
} }
}; };
}
} }
#endif #endif

View File

@ -37,8 +37,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
struct insert_default_values_data_t struct insert_default_values_data_t
{}; {};
@ -98,8 +96,8 @@ namespace sqlpp
std::tuple<simple_column_t<typename Assignments::_column_t>...> _columns; std::tuple<simple_column_t<typename Assignments::_column_t>...> _columns;
std::tuple<typename Assignments::_value_t...> _values; std::tuple<typename Assignments::_value_t...> _values;
std::tuple<Assignments...> _assignments; // FIXME: Need to replace _columns and _values by _assignments (connector-container requires assignments) std::tuple<Assignments...> _assignments; // FIXME: Need to replace _columns and _values by _assignments (connector-container requires assignments)
typename vendor::interpretable_list_t<Database> _dynamic_columns; interpretable_list_t<Database> _dynamic_columns;
typename vendor::interpretable_list_t<Database> _dynamic_values; interpretable_list_t<Database> _dynamic_values;
}; };
template<typename Database, typename... Assignments> template<typename Database, typename... Assignments>
@ -218,7 +216,7 @@ namespace sqlpp
~column_list_data_t() = default; ~column_list_data_t() = default;
#warning need to define just one version of value_tuple_t #warning need to define just one version of value_tuple_t
using _value_tuple_t = std::tuple<vendor::insert_value_t<Columns>...>; using _value_tuple_t = std::tuple<insert_value_t<Columns>...>;
std::tuple<simple_column_t<Columns>...> _columns; std::tuple<simple_column_t<Columns>...> _columns;
std::vector<_value_tuple_t> _insert_values; std::vector<_value_tuple_t> _insert_values;
}; };
@ -237,7 +235,7 @@ namespace sqlpp
static_assert(::sqlpp::detail::none_t<must_not_insert_t<Columns>::value...>::value, "at least one column argument has a must_not_insert flag in its definition"); static_assert(::sqlpp::detail::none_t<must_not_insert_t<Columns>::value...>::value, "at least one column argument has a must_not_insert flag in its definition");
using _value_tuple_t = std::tuple<vendor::insert_value_t<Columns>...>; using _value_tuple_t = std::tuple<insert_value_t<Columns>...>;
static_assert(required_tables_of<column_list_t>::size::value == 1, "columns from multiple tables in columns()"); static_assert(required_tables_of<column_list_t>::size::value == 1, "columns from multiple tables in columns()");
@ -252,7 +250,7 @@ namespace sqlpp
void add(Assignments... assignments) void add(Assignments... assignments)
{ {
static_assert(::sqlpp::detail::all_t<is_assignment_t<Assignments>::value...>::value, "add_values() arguments have to be assignments"); static_assert(::sqlpp::detail::all_t<is_assignment_t<Assignments>::value...>::value, "add_values() arguments have to be assignments");
using _arg_value_tuple = std::tuple<vendor::insert_value_t<typename Assignments::_column_t>...>; using _arg_value_tuple = std::tuple<insert_value_t<typename Assignments::_column_t>...>;
using _args_correct = std::is_same<_arg_value_tuple, _value_tuple_t>; using _args_correct = std::is_same<_arg_value_tuple, _value_tuple_t>;
static_assert(_args_correct::value, "add_values() arguments do not match columns() arguments"); static_assert(_args_correct::value, "add_values() arguments do not match columns() arguments");
@ -267,7 +265,7 @@ namespace sqlpp
template<typename... Assignments> template<typename... Assignments>
void _add_impl(const std::true_type&, Assignments... assignments) void _add_impl(const std::true_type&, Assignments... assignments)
{ {
return _data._insert_values.emplace_back(vendor::insert_value_t<typename Assignments::_column_t>{assignments}...); return _data._insert_values.emplace_back(insert_value_t<typename Assignments::_column_t>{assignments}...);
} }
template<typename... Assignments> template<typename... Assignments>
@ -373,7 +371,7 @@ namespace sqlpp
-> _new_statement_t<insert_list_t<_database_t, Args...>> -> _new_statement_t<insert_list_t<_database_t, Args...>>
{ {
static_assert(not std::is_same<_database_t, void>::value, "dynamic_set must not be called in a static statement"); static_assert(not std::is_same<_database_t, void>::value, "dynamic_set must not be called in a static statement");
return { *static_cast<typename Policies::_statement_t*>(this), vendor::insert_list_data_t<_database_t, Args...>{args...} }; return { *static_cast<typename Policies::_statement_t*>(this), insert_list_data_t<_database_t, Args...>{args...} };
} }
}; };
}; };
@ -447,7 +445,6 @@ namespace sqlpp
} }
}; };
}
} }
#endif #endif

View File

@ -186,56 +186,56 @@ namespace sqlpp
struct expression_operators: public basic_expression_operators<Base, is_numeric_t> struct expression_operators: public basic_expression_operators<Base, is_numeric_t>
{ {
template<typename T> template<typename T>
vendor::plus_t<Base, vendor::value_type_t<T>, vendor::wrap_operand_t<T>> operator +(T t) const plus_t<Base, value_type_t<T>, wrap_operand_t<T>> operator +(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand");
return { *static_cast<const Base*>(this), {t} }; return { *static_cast<const Base*>(this), {t} };
} }
template<typename T> template<typename T>
vendor::minus_t<Base, vendor::value_type_t<T>, vendor::wrap_operand_t<T>> operator -(T t) const minus_t<Base, value_type_t<T>, wrap_operand_t<T>> operator -(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand");
return { *static_cast<const Base*>(this), {t} }; return { *static_cast<const Base*>(this), {t} };
} }
template<typename T> template<typename T>
vendor::multiplies_t<Base, vendor::value_type_t<T>, vendor::wrap_operand_t<T>> operator *(T t) const multiplies_t<Base, value_type_t<T>, wrap_operand_t<T>> operator *(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand");
return { *static_cast<const Base*>(this), {t} }; return { *static_cast<const Base*>(this), {t} };
} }
template<typename T> template<typename T>
vendor::divides_t<Base, vendor::wrap_operand_t<T>> operator /(T t) const divides_t<Base, wrap_operand_t<T>> operator /(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand");
return { *static_cast<const Base*>(this), {t} }; return { *static_cast<const Base*>(this), {t} };
} }
template<typename T> template<typename T>
vendor::modulus_t<Base, vendor::wrap_operand_t<T>> operator %(T t) const modulus_t<Base, wrap_operand_t<T>> operator %(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand");
return { *static_cast<const Base*>(this), {t} }; return { *static_cast<const Base*>(this), {t} };
} }
vendor::unary_plus_t<integral, Base> operator +() const unary_plus_t<integral, Base> operator +() const
{ {
return { *static_cast<const Base*>(this) }; return { *static_cast<const Base*>(this) };
} }
vendor::unary_minus_t<integral, Base> operator -() const unary_minus_t<integral, Base> operator -() const
{ {
return { *static_cast<const Base*>(this) }; return { *static_cast<const Base*>(this) };
} }
@ -245,36 +245,36 @@ namespace sqlpp
struct column_operators struct column_operators
{ {
template<typename T> template<typename T>
auto operator +=(T t) const -> vendor::assignment_t<Base, vendor::plus_t<Base, vendor::value_type_t<T>, vendor::wrap_operand_t<T>>> auto operator +=(T t) const -> assignment_t<Base, plus_t<Base, value_type_t<T>, wrap_operand_t<T>>>
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } }; return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } };
} }
template<typename T> template<typename T>
auto operator -=(T t) const -> vendor::assignment_t<Base, vendor::minus_t<Base, vendor::value_type_t<T>, vendor::wrap_operand_t<T>>> auto operator -=(T t) const -> assignment_t<Base, minus_t<Base, value_type_t<T>, wrap_operand_t<T>>>
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } }; return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } };
} }
template<typename T> template<typename T>
auto operator /=(T t) const -> vendor::assignment_t<Base, vendor::divides_t<Base, vendor::wrap_operand_t<T>>> auto operator /=(T t) const -> assignment_t<Base, divides_t<Base, wrap_operand_t<T>>>
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } }; return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } };
} }
template<typename T> template<typename T>
auto operator *=(T t) const -> vendor::assignment_t<Base, vendor::multiplies_t<Base, vendor::value_type_t<T>, vendor::wrap_operand_t<T>>> auto operator *=(T t) const -> assignment_t<Base, multiplies_t<Base, value_type_t<T>, wrap_operand_t<T>>>
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } }; return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } };

View File

@ -33,9 +33,9 @@ namespace sqlpp
{ {
template<typename T, typename Context> template<typename T, typename Context>
auto interpret(const T& t, Context& context) auto interpret(const T& t, Context& context)
-> decltype(vendor::interpreter_t<Context, T>::_(t, context)) -> decltype(interpreter_t<Context, T>::_(t, context))
{ {
return vendor::interpreter_t<Context, T>::_(t, context); return interpreter_t<Context, T>::_(t, context);
} }
} }

View File

@ -35,8 +35,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename Db> template<typename Db>
struct interpretable_t struct interpretable_t
{ {
@ -125,7 +123,6 @@ namespace sqlpp
} }
}; };
}
} }
#endif #endif

View File

@ -32,8 +32,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename Db> template<typename Db>
struct interpretable_list_t struct interpretable_list_t
{ {
@ -113,7 +111,6 @@ namespace sqlpp
return serializable_list_interpreter_t<Context, T>::_(t, separator, context); return serializable_list_interpreter_t<Context, T>::_(t, separator, context);
} }
}
} }
#endif #endif

View File

@ -31,8 +31,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename Context, typename T, typename Enable = void> template<typename Context, typename T, typename Enable = void>
struct interpreter_t struct interpreter_t
{ {
@ -41,7 +39,6 @@ namespace sqlpp
static_assert(wrong_t<Context, T>::value, "missing interpreter specialization"); static_assert(wrong_t<Context, T>::value, "missing interpreter specialization");
} }
}; };
}
} }

View File

@ -34,8 +34,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
// A SINGLE TABLE DATA // A SINGLE TABLE DATA
template<typename Database, typename Table> template<typename Database, typename Table>
struct into_data_t struct into_data_t
@ -192,7 +190,6 @@ namespace sqlpp
} }
}; };
}
} }
#endif #endif

View File

@ -33,8 +33,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<bool NotInverted, typename Operand> template<bool NotInverted, typename Operand>
struct is_null_t: public boolean::template expression_operators<is_null_t<NotInverted, Operand>>, struct is_null_t: public boolean::template expression_operators<is_null_t<NotInverted, Operand>>,
public alias_operators<is_null_t<NotInverted, Operand>> public alias_operators<is_null_t<NotInverted, Operand>>
@ -73,9 +71,9 @@ namespace sqlpp
}; };
template<typename Context, bool NotInverted, typename Operand> template<typename Context, bool NotInverted, typename Operand>
struct serializer_t<Context, ::sqlpp::vendor::is_null_t<NotInverted, Operand>> struct serializer_t<Context, ::sqlpp::is_null_t<NotInverted, Operand>>
{ {
using T = ::sqlpp::vendor::is_null_t<NotInverted, Operand>; using T = ::sqlpp::is_null_t<NotInverted, Operand>;
static Context& _(const T& t, Context& context) static Context& _(const T& t, Context& context)
{ {
@ -84,7 +82,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
} }

View File

@ -29,11 +29,8 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<bool NotInverted, typename Operand> template<bool NotInverted, typename Operand>
struct is_null_t; struct is_null_t;
}
} }
#endif #endif

View File

@ -74,7 +74,7 @@ namespace sqlpp
static constexpr const char* _name = " RIGHT OUTER "; static constexpr const char* _name = " RIGHT OUTER ";
}; };
template<typename JoinType, typename Lhs, typename Rhs, typename On = vendor::noop> template<typename JoinType, typename Lhs, typename Rhs, typename On = noop>
struct join_t struct join_t
{ {
using _traits = make_traits<no_value_t, tag::table, tag::join>; using _traits = make_traits<no_value_t, tag::table, tag::join>;
@ -83,7 +83,7 @@ namespace sqlpp
static_assert(is_table_t<Lhs>::value, "lhs argument for join() has to be a table or join"); static_assert(is_table_t<Lhs>::value, "lhs argument for join() has to be a table or join");
static_assert(is_table_t<Rhs>::value, "rhs argument for join() has to be a table"); static_assert(is_table_t<Rhs>::value, "rhs argument for join() has to be a table");
static_assert(not is_join_t<Rhs>::value, "rhs argument for join must not be a join"); static_assert(not is_join_t<Rhs>::value, "rhs argument for join must not be a join");
static_assert(vendor::is_noop<On>::value or is_on_t<On>::value, "invalid on expression in join().on()"); static_assert(is_noop<On>::value or is_on_t<On>::value, "invalid on expression in join().on()");
static_assert(::sqlpp::detail::is_disjunct_from<provided_tables_of<Lhs>, provided_tables_of<Rhs>>::value, "joined tables must not be identical"); static_assert(::sqlpp::detail::is_disjunct_from<provided_tables_of<Lhs>, provided_tables_of<Rhs>>::value, "joined tables must not be identical");
@ -96,7 +96,7 @@ namespace sqlpp
auto on(Expr... expr) auto on(Expr... expr)
-> set_on_t<on_t<void, Expr...>> -> set_on_t<on_t<void, Expr...>>
{ {
static_assert(vendor::is_noop<On>::value, "cannot call on() twice for a single join()"); static_assert(is_noop<On>::value, "cannot call on() twice for a single join()");
return { _lhs, return { _lhs,
_rhs, _rhs,
{std::tuple<Expr...>{expr...}} {std::tuple<Expr...>{expr...}}
@ -106,35 +106,35 @@ namespace sqlpp
template<typename T> template<typename T>
join_t<inner_join_t, join_t, T> join(T t) join_t<inner_join_t, join_t, T> join(T t)
{ {
static_assert(not vendor::is_noop<On>::value, "join type requires on()"); static_assert(not is_noop<On>::value, "join type requires on()");
return { *this, t }; return { *this, t };
} }
template<typename T> template<typename T>
join_t<inner_join_t, join_t, T> inner_join(T t) join_t<inner_join_t, join_t, T> inner_join(T t)
{ {
static_assert(not vendor::is_noop<On>::value, "join type requires on()"); static_assert(not is_noop<On>::value, "join type requires on()");
return { *this, t }; return { *this, t };
} }
template<typename T> template<typename T>
join_t<outer_join_t, join_t, T> outer_join(T t) join_t<outer_join_t, join_t, T> outer_join(T t)
{ {
static_assert(not vendor::is_noop<On>::value, "join type requires on()"); static_assert(not is_noop<On>::value, "join type requires on()");
return { *this, t }; return { *this, t };
} }
template<typename T> template<typename T>
join_t<left_outer_join_t, join_t, T> left_outer_join(T t) join_t<left_outer_join_t, join_t, T> left_outer_join(T t)
{ {
static_assert(not vendor::is_noop<On>::value, "join type requires on()"); static_assert(not is_noop<On>::value, "join type requires on()");
return { *this, t }; return { *this, t };
} }
template<typename T> template<typename T>
join_t<right_outer_join_t, join_t, T> right_outer_join(T t) join_t<right_outer_join_t, join_t, T> right_outer_join(T t)
{ {
static_assert(not vendor::is_noop<On>::value, "join type requires on()"); static_assert(not is_noop<On>::value, "join type requires on()");
return { *this, t }; return { *this, t };
} }
@ -143,8 +143,6 @@ namespace sqlpp
On _on; On _on;
}; };
namespace vendor
{
template<typename Context, typename JoinType, typename Lhs, typename Rhs, typename On> template<typename Context, typename JoinType, typename Lhs, typename Rhs, typename On>
struct serializer_t<Context, join_t<JoinType, Lhs, Rhs, On>> struct serializer_t<Context, join_t<JoinType, Lhs, Rhs, On>>
{ {
@ -152,7 +150,7 @@ namespace sqlpp
static Context& _(const T& t, Context& context) static Context& _(const T& t, Context& context)
{ {
static_assert(not vendor::is_noop<On>::value, "joined tables require on()"); static_assert(not is_noop<On>::value, "joined tables require on()");
serialize(t._lhs, context); serialize(t._lhs, context);
context << JoinType::_name; context << JoinType::_name;
context << " JOIN "; context << " JOIN ";
@ -162,7 +160,6 @@ namespace sqlpp
} }
}; };
}
} }
#endif #endif

View File

@ -33,8 +33,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename Operand, typename Pattern> template<typename Operand, typename Pattern>
struct like_t: public boolean::template expression_operators<like_t<Operand, Pattern>>, struct like_t: public boolean::template expression_operators<like_t<Operand, Pattern>>,
public alias_operators<like_t<Operand, Pattern>> public alias_operators<like_t<Operand, Pattern>>
@ -84,7 +82,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
} }
#endif #endif

View File

@ -33,8 +33,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
// LIMIT DATA // LIMIT DATA
template<typename Limit> template<typename Limit>
struct limit_data_t struct limit_data_t
@ -254,7 +252,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
} }
#endif #endif

View File

@ -31,8 +31,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename Expr> template<typename Expr>
struct max_t: public value_type_of<Expr>::template expression_operators<max_t<Expr>>, struct max_t: public value_type_of<Expr>::template expression_operators<max_t<Expr>>,
public alias_operators<max_t<Expr>> public alias_operators<max_t<Expr>>
@ -66,14 +64,11 @@ namespace sqlpp
Expr _expr; Expr _expr;
}; };
}
namespace vendor
{
template<typename Context, typename Expr> template<typename Context, typename Expr>
struct serializer_t<Context, vendor::max_t<Expr>> struct serializer_t<Context, max_t<Expr>>
{ {
using T = vendor::max_t<Expr>; using T = max_t<Expr>;
static Context& _(const T& t, Context& context) static Context& _(const T& t, Context& context)
{ {
@ -83,12 +78,11 @@ namespace sqlpp
return context; return context;
} }
}; };
}
template<typename T> template<typename T>
auto max(T t) -> typename vendor::max_t<vendor::wrap_operand_t<T>> auto max(T t) -> typename max_t<wrap_operand_t<T>>
{ {
static_assert(is_expression_t<vendor::wrap_operand_t<T>>::value, "max() requires a value expression as argument"); static_assert(is_expression_t<wrap_operand_t<T>>::value, "max() requires a value expression as argument");
return { t }; return { t };
} }

View File

@ -31,8 +31,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename Expr> template<typename Expr>
struct min_t: public value_type_of<Expr>::template expression_operators<min_t<Expr>>, struct min_t: public value_type_of<Expr>::template expression_operators<min_t<Expr>>,
public alias_operators<min_t<Expr>> public alias_operators<min_t<Expr>>
@ -66,14 +64,11 @@ namespace sqlpp
Expr _expr; Expr _expr;
}; };
}
namespace vendor
{
template<typename Context, typename Expr> template<typename Context, typename Expr>
struct serializer_t<Context, vendor::min_t<Expr>> struct serializer_t<Context, min_t<Expr>>
{ {
using T = vendor::min_t<Expr>; using T = min_t<Expr>;
static Context& _(const T& t, Context& context) static Context& _(const T& t, Context& context)
{ {
@ -83,12 +78,11 @@ namespace sqlpp
return context; return context;
} }
}; };
}
template<typename T> template<typename T>
auto min(T t) -> typename vendor::min_t<vendor::wrap_operand_t<T>> auto min(T t) -> typename min_t<wrap_operand_t<T>>
{ {
static_assert(is_expression_t<vendor::wrap_operand_t<T>>::value, "min() requires a value expression as argument"); static_assert(is_expression_t<wrap_operand_t<T>>::value, "min() requires a value expression as argument");
return { t }; return { t };
} }

View File

@ -110,8 +110,6 @@ namespace sqlpp
std::tuple<Columns...> _columns; std::tuple<Columns...> _columns;
}; };
namespace vendor
{
template<typename Context, typename... Columns> template<typename Context, typename... Columns>
struct serializer_t<Context, multi_column_t<void, Columns...>> struct serializer_t<Context, multi_column_t<void, Columns...>>
{ {
@ -134,7 +132,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
namespace detail namespace detail
{ {

View File

@ -33,8 +33,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename Db> template<typename Db>
struct named_interpretable_t struct named_interpretable_t
{ {
@ -133,7 +131,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
} }

View File

@ -33,8 +33,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
#warning: Need extra include file for no_data #warning: Need extra include file for no_data
struct no_data_t {}; struct no_data_t {};
@ -74,7 +72,6 @@ namespace sqlpp
template<typename T> template<typename T>
struct is_noop: std::is_same<T, noop> {}; struct is_noop: std::is_same<T, noop> {};
}
} }
#endif #endif

View File

@ -29,12 +29,9 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
struct noop; struct noop;
template<typename T> template<typename T>
struct is_noop; struct is_noop;
}
} }
#endif #endif

View File

@ -37,8 +37,6 @@ namespace sqlpp
using _recursive_traits = make_recursive_traits<>; using _recursive_traits = make_recursive_traits<>;
}; };
namespace vendor
{
template<typename Context> template<typename Context>
struct serializer_t<Context, null_t> struct serializer_t<Context, null_t>
{ {
@ -50,7 +48,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
constexpr null_t null = {}; constexpr null_t null = {};

View File

@ -33,8 +33,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
// OFFSET DATA // OFFSET DATA
template<typename Offset> template<typename Offset>
struct offset_data_t struct offset_data_t
@ -264,7 +262,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
} }
#endif #endif

View File

@ -53,11 +53,9 @@ namespace sqlpp
} }
std::tuple<Expr...> _expressions; std::tuple<Expr...> _expressions;
vendor::interpretable_list_t<Database> _dynamic_expressions; interpretable_list_t<Database> _dynamic_expressions;
}; };
namespace vendor
{
template<typename Context, typename Database, typename... Expr> template<typename Context, typename Database, typename... Expr>
struct serializer_t<Context, on_t<Database, Expr...>> struct serializer_t<Context, on_t<Database, Expr...>>
{ {
@ -76,7 +74,6 @@ namespace sqlpp
} }
}; };
}
} }
#endif #endif

View File

@ -37,8 +37,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
// ORDER BY DATA // ORDER BY DATA
template<typename Database, typename... Expressions> template<typename Database, typename... Expressions>
struct order_by_data_t struct order_by_data_t
@ -54,7 +52,7 @@ namespace sqlpp
~order_by_data_t() = default; ~order_by_data_t() = default;
std::tuple<Expressions...> _expressions; std::tuple<Expressions...> _expressions;
vendor::interpretable_list_t<Database> _dynamic_expressions; interpretable_list_t<Database> _dynamic_expressions;
}; };
// ORDER BY // ORDER BY
@ -208,7 +206,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
} }
#endif #endif

View File

@ -57,8 +57,6 @@ namespace sqlpp
~parameter_t() = default; ~parameter_t() = default;
}; };
namespace vendor
{
template<typename Context, typename ValueType, typename NameType> template<typename Context, typename ValueType, typename NameType>
struct serializer_t<Context, parameter_t<ValueType, NameType>> struct serializer_t<Context, parameter_t<ValueType, NameType>>
{ {
@ -70,7 +68,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
template<typename NamedExpr> template<typename NamedExpr>
auto parameter(const NamedExpr&) auto parameter(const NamedExpr&)
@ -82,7 +79,7 @@ namespace sqlpp
template<typename ValueType, typename AliasProvider> template<typename ValueType, typename AliasProvider>
auto parameter(const ValueType&, const AliasProvider&) auto parameter(const ValueType&, const AliasProvider&)
-> parameter_t<vendor::wrap_operand_t<ValueType>, AliasProvider> -> parameter_t<wrap_operand_t<ValueType>, AliasProvider>
{ {
static_assert(is_expression_t<ValueType>::value, "first argument is not a value type"); static_assert(is_expression_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");

View File

@ -37,7 +37,7 @@ namespace sqlpp
template<typename T> template<typename T>
struct parameter_list_t struct parameter_list_t
{ {
static_assert(vendor::wrong_t<T>::value, "Template parameter for parameter_list_t has to be a tuple"); static_assert(wrong_t<T>::value, "Template parameter for parameter_list_t has to be a tuple");
}; };
template<typename... Parameter> template<typename... Parameter>

View File

@ -31,8 +31,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename Needle, typename Replacement> template<typename Needle, typename Replacement>
struct policy_update_impl struct policy_update_impl
{ {
@ -52,7 +50,6 @@ namespace sqlpp
template<typename Original, typename Needle, typename Replacement> template<typename Original, typename Needle, typename Replacement>
using update_policies_t = typename update_policies_impl<Original, Needle, Replacement>::type; using update_policies_t = typename update_policies_impl<Original, Needle, Replacement>::type;
}
} }

View File

@ -41,7 +41,7 @@
namespace sqlpp namespace sqlpp
{ {
struct remove_name_t {}; struct remove_name_t {};
struct remove_t: public vendor::statement_name_t<remove_name_t> struct remove_t: public statement_name_t<remove_name_t>
{ {
using _traits = make_traits<no_value_t, tag::return_value>; using _traits = make_traits<no_value_t, tag::return_value>;
struct _name_t {}; struct _name_t {};
@ -79,8 +79,6 @@ namespace sqlpp
}; };
namespace vendor
{
template<typename Context> template<typename Context>
struct serializer_t<Context, remove_name_t> struct serializer_t<Context, remove_name_t>
{ {
@ -93,15 +91,14 @@ namespace sqlpp
return context; return context;
} }
}; };
}
template<typename Database> template<typename Database>
using blank_remove_t = statement_t<Database, using blank_remove_t = statement_t<Database,
remove_t, remove_t,
vendor::no_from_t, no_from_t,
vendor::no_using_t, no_using_t,
vendor::no_extra_tables_t, no_extra_tables_t,
vendor::no_where_t>; no_where_t>;
auto remove() auto remove()
-> blank_remove_t<void> -> blank_remove_t<void>

View File

@ -76,7 +76,7 @@ namespace sqlpp
}; };
template<std::size_t index, typename AliasProvider, typename Db, typename... NamedExprs> template<std::size_t index, typename AliasProvider, typename Db, typename... NamedExprs>
struct result_field<Db, index, vendor::multi_field_t<AliasProvider, std::tuple<NamedExprs...>>>: struct result_field<Db, index, multi_field_t<AliasProvider, std::tuple<NamedExprs...>>>:
public AliasProvider::_name_t::template _member_t<result_row_impl<Db, detail::make_column_index_sequence<index, NamedExprs...>, NamedExprs...>> public AliasProvider::_name_t::template _member_t<result_row_impl<Db, detail::make_column_index_sequence<index, NamedExprs...>, NamedExprs...>>
{ {
using _multi_field = typename AliasProvider::_name_t::template _member_t<result_row_impl<Db, detail::make_column_index_sequence<index, NamedExprs...>, NamedExprs...>>; using _multi_field = typename AliasProvider::_name_t::template _member_t<result_row_impl<Db, detail::make_column_index_sequence<index, NamedExprs...>, NamedExprs...>>;

View File

@ -48,11 +48,9 @@ namespace sqlpp
{ {
struct select_name_t {}; struct select_name_t {};
struct select_t: public vendor::statement_name_t<select_name_t> struct select_t: public statement_name_t<select_name_t>
{}; {};
namespace vendor
{
template<typename Context> template<typename Context>
struct serializer_t<Context, select_name_t> struct serializer_t<Context, select_name_t>
{ {
@ -65,21 +63,20 @@ namespace sqlpp
return context; return context;
} }
}; };
}
template<typename Database> template<typename Database>
using blank_select_t = statement_t<Database, using blank_select_t = statement_t<Database,
select_t, select_t,
vendor::no_select_flag_list_t, no_select_flag_list_t,
vendor::no_select_column_list_t, no_select_column_list_t,
vendor::no_from_t, no_from_t,
vendor::no_extra_tables_t, no_extra_tables_t,
vendor::no_where_t, no_where_t,
vendor::no_group_by_t, no_group_by_t,
vendor::no_having_t, no_having_t,
vendor::no_order_by_t, no_order_by_t,
vendor::no_limit_t, no_limit_t,
vendor::no_offset_t>; no_offset_t>;
blank_select_t<void> select() // FIXME: These should be constexpr blank_select_t<void> select() // FIXME: These should be constexpr

View File

@ -59,13 +59,11 @@ namespace sqlpp
}; };
} }
namespace vendor
{
template<typename Db> template<typename Db>
struct dynamic_select_column_list struct dynamic_select_column_list
{ {
using _names_t = std::vector<std::string>; using _names_t = std::vector<std::string>;
std::vector<vendor::named_interpretable_t<Db>> _dynamic_columns; std::vector<named_interpretable_t<Db>> _dynamic_columns;
_names_t _dynamic_expression_names; _names_t _dynamic_expression_names;
template<typename Expr> template<typename Expr>
@ -311,18 +309,15 @@ namespace sqlpp
}; };
}; };
}
namespace detail namespace detail
{ {
template<typename Database, typename... Columns> template<typename Database, typename... Columns>
using make_select_column_list_t = using make_select_column_list_t =
copy_tuple_args_t<vendor::select_column_list_t, Database, copy_tuple_args_t<select_column_list_t, Database,
decltype(std::tuple_cat(as_tuple<Columns>::_(std::declval<Columns>())...))>; decltype(std::tuple_cat(as_tuple<Columns>::_(std::declval<Columns>())...))>;
} }
namespace vendor
{
struct no_select_column_list_t struct no_select_column_list_t
{ {
using _traits = make_traits<no_value_t, ::sqlpp::tag::noop, ::sqlpp::tag::missing>; using _traits = make_traits<no_value_t, ::sqlpp::tag::noop, ::sqlpp::tag::missing>;
@ -401,7 +396,6 @@ namespace sqlpp
} }
}; };
}
} }
#endif #endif

View File

@ -36,8 +36,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
// SELECTED FLAGS DATA // SELECTED FLAGS DATA
template<typename Database, typename... Flags> template<typename Database, typename... Flags>
struct select_flag_list_data_t struct select_flag_list_data_t
@ -53,7 +51,7 @@ namespace sqlpp
~select_flag_list_data_t() = default; ~select_flag_list_data_t() = default;
std::tuple<Flags...> _flags; std::tuple<Flags...> _flags;
vendor::interpretable_list_t<Database> _dynamic_flags; interpretable_list_t<Database> _dynamic_flags;
}; };
// SELECT FLAGS // SELECT FLAGS
@ -207,7 +205,6 @@ namespace sqlpp
} }
}; };
}
} }

View File

@ -42,8 +42,6 @@ namespace sqlpp
}; };
static constexpr all_t all = {}; static constexpr all_t all = {};
namespace vendor
{
template<typename Context> template<typename Context>
struct serializer_t<Context, all_t> struct serializer_t<Context, all_t>
{ {
@ -53,7 +51,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
struct distinct_t struct distinct_t
{ {
@ -62,8 +59,6 @@ namespace sqlpp
}; };
static constexpr distinct_t distinct = {}; static constexpr distinct_t distinct = {};
namespace vendor
{
template<typename Context> template<typename Context>
struct serializer_t<Context, distinct_t> struct serializer_t<Context, distinct_t>
{ {
@ -73,7 +68,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
struct straight_join_t struct straight_join_t
{ {
@ -82,8 +76,6 @@ namespace sqlpp
}; };
static constexpr straight_join_t straight_join = {}; static constexpr straight_join_t straight_join = {};
namespace vendor
{
template<typename Context> template<typename Context>
struct serializer_t<Context, straight_join_t> struct serializer_t<Context, straight_join_t>
{ {
@ -93,7 +85,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
} }

View File

@ -72,8 +72,6 @@ namespace sqlpp
Select _select; Select _select;
}; };
namespace vendor
{
template<typename Context, typename Select, typename... NamedExpr> template<typename Context, typename Select, typename... NamedExpr>
struct serializer_t<Context, select_pseudo_table_t<Select, NamedExpr...>> struct serializer_t<Context, select_pseudo_table_t<Select, NamedExpr...>>
{ {
@ -86,7 +84,6 @@ namespace sqlpp
} }
}; };
}
} }
#endif #endif

View File

@ -33,21 +33,18 @@ namespace sqlpp
{ {
template<typename T, typename Context> template<typename T, typename Context>
auto serialize(const T& t, Context& context) auto serialize(const T& t, Context& context)
-> decltype(vendor::serializer_t<Context, T>::_(t, context)) -> decltype(serializer_t<Context, T>::_(t, context))
{ {
return vendor::serializer_t<Context, T>::_(t, context); return serializer_t<Context, T>::_(t, context);
} }
/* /*
namespace vendor // Required if you want to call serialize(sqlpp::value(7), printer), for instance
{
template<typename T, typename Context> template<typename T, typename Context>
auto serialize(const T& t, Context& context) auto serialize(const T& t, Context& context)
-> decltype(vendor::serializer_t<Context, T>::_(t, context)) -> decltype(serializer_t<Context, T>::_(t, context))
{ {
return vendor::serializer_t<Context, T>::_(t, context); return serializer_t<Context, T>::_(t, context);
} }
}
*/ */
} }

View File

@ -31,8 +31,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename Context, typename T, typename Enable = void> template<typename Context, typename T, typename Enable = void>
struct serializer_t struct serializer_t
{ {
@ -41,7 +39,6 @@ namespace sqlpp
static_assert(wrong_t<Context, T>::value, "missing serializer specialization"); static_assert(wrong_t<Context, T>::value, "missing serializer specialization");
} }
}; };
}
} }

View File

@ -31,8 +31,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename Column> template<typename Column>
struct simple_column_t struct simple_column_t
{ {
@ -56,7 +54,6 @@ namespace sqlpp
{ {
return {c}; return {c};
} }
}
} }
#endif #endif

View File

@ -34,8 +34,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
// A SINGLE TABLE DATA // A SINGLE TABLE DATA
template<typename Database, typename Table> template<typename Database, typename Table>
struct single_table_data_t struct single_table_data_t
@ -211,7 +209,6 @@ namespace sqlpp
} }
}; };
}
} }
#endif #endif

View File

@ -32,8 +32,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename Select> template<typename Select>
struct some_t struct some_t
{ {
@ -64,14 +62,11 @@ namespace sqlpp
Select _select; Select _select;
}; };
}
namespace vendor
{
template<typename Context, typename Select> template<typename Context, typename Select>
struct serializer_t<Context, vendor::some_t<Select>> struct serializer_t<Context, some_t<Select>>
{ {
using T = vendor::some_t<Select>; using T = some_t<Select>;
static Context& _(const T& t, Context& context) static Context& _(const T& t, Context& context)
{ {
@ -81,13 +76,12 @@ namespace sqlpp
return context; return context;
} }
}; };
}
template<typename T> template<typename T>
auto some(T t) -> typename vendor::some_t<vendor::wrap_operand_t<T>> auto some(T t) -> typename some_t<wrap_operand_t<T>>
{ {
static_assert(is_select_t<vendor::wrap_operand_t<T>>::value, "some() requires a single column select expression as argument"); static_assert(is_select_t<wrap_operand_t<T>>::value, "some() requires a single column select expression as argument");
static_assert(is_expression_t<vendor::wrap_operand_t<T>>::value, "some() requires a single column select expression as argument"); static_assert(is_expression_t<wrap_operand_t<T>>::value, "some() requires a single column select expression as argument");
return { t }; return { t };
} }

View File

@ -46,8 +46,6 @@ namespace sqlpp
Expression _expression; Expression _expression;
}; };
namespace vendor
{
template<typename Context, typename Expression, sort_type SortType> template<typename Context, typename Expression, sort_type SortType>
struct serializer_t<Context, sort_order_t<Expression, SortType>> struct serializer_t<Context, sort_order_t<Expression, SortType>>
{ {
@ -69,7 +67,6 @@ namespace sqlpp
} }
}; };
}
} }
#endif #endif

View File

@ -61,7 +61,7 @@ namespace sqlpp
struct _policies_update_t struct _policies_update_t
{ {
static_assert(detail::is_element_of<Needle, make_type_set_t<Policies...>>::value, "policies update for non-policy class detected"); static_assert(detail::is_element_of<Needle, make_type_set_t<Policies...>>::value, "policies update for non-policy class detected");
using type = statement_t<Db, vendor::policy_update_t<Policies, Needle, Replacement>...>; using type = statement_t<Db, policy_update_t<Policies, Needle, Replacement>...>;
}; };
template<typename Needle, typename Replacement> template<typename Needle, typename Replacement>
@ -82,7 +82,7 @@ namespace sqlpp
_all_provided_tables // Hint: extra_tables are not used here because they are just a helper for dynamic .add_*() _all_provided_tables // Hint: extra_tables are not used here because they are just a helper for dynamic .add_*()
>; >;
using _result_type_provider = detail::get_last_if<is_return_value_t, vendor::noop, Policies...>; using _result_type_provider = detail::get_last_if<is_return_value_t, noop, Policies...>;
struct _result_methods_t: public _result_type_provider::template _result_methods_t<statement_policies_t> struct _result_methods_t: public _result_type_provider::template _result_methods_t<statement_policies_t>
{}; {};
@ -181,8 +181,6 @@ namespace sqlpp
}; };
namespace vendor
{
template<typename Context, typename Database, typename... Policies> template<typename Context, typename Database, typename... Policies>
struct serializer_t<Context, statement_t<Database, Policies...>> struct serializer_t<Context, statement_t<Database, Policies...>>
{ {
@ -238,7 +236,6 @@ namespace sqlpp
}; };
}; };
}
} }
#endif #endif

View File

@ -31,8 +31,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename Flag, typename Expr> template<typename Flag, typename Expr>
struct sum_t: public value_type_of<Expr>::template expression_operators<sum_t<Flag, Expr>>, struct sum_t: public value_type_of<Expr>::template expression_operators<sum_t<Flag, Expr>>,
public alias_operators<sum_t<Flag, Expr>> public alias_operators<sum_t<Flag, Expr>>
@ -67,14 +65,11 @@ namespace sqlpp
Expr _expr; Expr _expr;
}; };
}
namespace vendor
{
template<typename Context, typename Flag, typename Expr> template<typename Context, typename Flag, typename Expr>
struct serializer_t<Context, vendor::sum_t<Flag, Expr>> struct serializer_t<Context, sum_t<Flag, Expr>>
{ {
using T = vendor::sum_t<Flag, Expr>; using T = sum_t<Flag, Expr>;
static Context& _(const T& t, Context& context) static Context& _(const T& t, Context& context)
{ {
@ -89,19 +84,18 @@ namespace sqlpp
return context; return context;
} }
}; };
}
template<typename T> template<typename T>
auto sum(T t) -> typename vendor::sum_t<vendor::noop, vendor::wrap_operand_t<T>> auto sum(T t) -> typename sum_t<noop, wrap_operand_t<T>>
{ {
static_assert(is_numeric_t<vendor::wrap_operand_t<T>>::value, "sum() requires a numeric expression as argument"); static_assert(is_numeric_t<wrap_operand_t<T>>::value, "sum() requires a numeric expression as argument");
return { t }; return { t };
} }
template<typename T> template<typename T>
auto sum(const sqlpp::distinct_t&, T t) -> typename vendor::sum_t<sqlpp::distinct_t, vendor::wrap_operand_t<T>> auto sum(const sqlpp::distinct_t&, T t) -> typename sum_t<sqlpp::distinct_t, wrap_operand_t<T>>
{ {
static_assert(is_numeric_t<vendor::wrap_operand_t<T>>::value, "sum() requires a numeric expression as argument"); static_assert(is_numeric_t<wrap_operand_t<T>>::value, "sum() requires a numeric expression as argument");
return { t }; return { t };
} }

View File

@ -101,8 +101,6 @@ namespace sqlpp
} }
}; };
namespace vendor
{
template<typename Context, typename X> template<typename Context, typename X>
struct serializer_t<Context, X, typename std::enable_if<std::is_base_of<table_base_t, X>::value and not is_pseudo_table_t<X>::value, void>::type> struct serializer_t<Context, X, typename std::enable_if<std::is_base_of<table_base_t, X>::value and not is_pseudo_table_t<X>::value, void>::type>
{ {
@ -116,7 +114,6 @@ namespace sqlpp
}; };
}
} }
#endif #endif

View File

@ -61,8 +61,6 @@ namespace sqlpp
Table _table; Table _table;
}; };
namespace vendor
{
template<typename Context, typename AliasProvider, typename Table, typename... ColumnSpec> template<typename Context, typename AliasProvider, typename Table, typename... ColumnSpec>
struct serializer_t<Context, table_alias_t<AliasProvider, Table, ColumnSpec...>> struct serializer_t<Context, table_alias_t<AliasProvider, Table, ColumnSpec...>>
{ {
@ -77,7 +75,6 @@ namespace sqlpp
} }
}; };
}
} }
#endif #endif

View File

@ -189,18 +189,18 @@ namespace sqlpp
struct expression_operators: public basic_expression_operators<Base, is_text_t> struct expression_operators: public basic_expression_operators<Base, is_text_t>
{ {
template<typename T> template<typename T>
vendor::concat_t<Base, vendor::wrap_operand_t<T>> operator+(T t) const concat_t<Base, wrap_operand_t<T>> operator+(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs operand");
return { *static_cast<const Base*>(this), {t} }; return { *static_cast<const Base*>(this), {t} };
} }
template<typename T> template<typename T>
vendor::like_t<Base, vendor::wrap_operand_t<T>> like(T t) const like_t<Base, wrap_operand_t<T>> like(T t) const
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid argument for like()"); static_assert(_is_valid_operand<rhs>::value, "invalid argument for like()");
return { *static_cast<const Base*>(this), {t} }; return { *static_cast<const Base*>(this), {t} };
@ -211,9 +211,9 @@ namespace sqlpp
struct column_operators struct column_operators
{ {
template<typename T> template<typename T>
auto operator +=(T t) const -> vendor::assignment_t<Base, vendor::concat_t<Base, vendor::wrap_operand_t<T>>> auto operator +=(T t) const -> assignment_t<Base, concat_t<Base, wrap_operand_t<T>>>
{ {
using rhs = vendor::wrap_operand_t<T>; using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand"); static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } }; return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } };

View File

@ -61,8 +61,6 @@ namespace sqlpp
Operand _value; Operand _value;
}; };
namespace vendor
{
template<typename Context, typename Operand> template<typename Context, typename Operand>
struct serializer_t<Context, tvin_t<Operand>> struct serializer_t<Context, tvin_t<Operand>>
{ {
@ -70,10 +68,9 @@ namespace sqlpp
static void _(const T& t, Context& context) static void _(const T& t, Context& context)
{ {
static_assert(vendor::wrong_t<T>::value, "tvin() must not be used with anything but =, ==, != and !"); static_assert(wrong_t<T>::value, "tvin() must not be used with anything but =, ==, != and !");
} }
}; };
}
template<typename Operand> template<typename Operand>
struct maybe_tvin_t struct maybe_tvin_t
@ -121,8 +118,6 @@ namespace sqlpp
typename tvin_t<Operand>::_operand_t _value; typename tvin_t<Operand>::_operand_t _value;
}; };
namespace vendor
{
template<typename Context, typename Operand> template<typename Context, typename Operand>
struct serializer_t<Context, maybe_tvin_t<Operand>> struct serializer_t<Context, maybe_tvin_t<Operand>>
{ {
@ -141,13 +136,12 @@ namespace sqlpp
return context; return context;
} }
}; };
}
template<typename Operand> template<typename Operand>
auto tvin(Operand operand) -> tvin_t<typename vendor::wrap_operand<Operand>::type> auto tvin(Operand operand) -> tvin_t<typename wrap_operand<Operand>::type>
{ {
using _operand_t = typename vendor::wrap_operand<Operand>::type; using _operand_t = typename wrap_operand<Operand>::type;
static_assert(std::is_same<_operand_t, vendor::text_operand>::value static_assert(std::is_same<_operand_t, text_operand>::value
or not std::is_same<_operand_t, Operand>::value, "tvin() used with invalid type (only string and primitive types allowed)"); or not std::is_same<_operand_t, Operand>::value, "tvin() used with invalid type (only string and primitive types allowed)");
return {{operand}}; return {{operand}};
} }

View File

@ -41,7 +41,7 @@ namespace sqlpp
{ {
struct update_name_t {}; struct update_name_t {};
struct update_t: public vendor::statement_name_t<update_name_t> struct update_t: public statement_name_t<update_name_t>
{ {
using _traits = make_traits<no_value_t, tag::return_value>; using _traits = make_traits<no_value_t, tag::return_value>;
struct _name_t {}; struct _name_t {};
@ -79,8 +79,6 @@ namespace sqlpp
}; };
namespace vendor
{
template<typename Context> template<typename Context>
struct serializer_t<Context, update_name_t> struct serializer_t<Context, update_name_t>
{ {
@ -93,14 +91,13 @@ namespace sqlpp
return context; return context;
} }
}; };
}
template<typename Database> template<typename Database>
using blank_update_t = statement_t<Database, using blank_update_t = statement_t<Database,
update_t, update_t,
vendor::no_single_table_t, no_single_table_t,
vendor::no_update_list_t, no_update_list_t,
vendor::no_where_t>; no_where_t>;
template<typename Table> template<typename Table>
constexpr auto update(Table table) constexpr auto update(Table table)

View File

@ -34,8 +34,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
// UPDATE ASSIGNMENTS DATA // UPDATE ASSIGNMENTS DATA
template<typename Database, typename... Assignments> template<typename Database, typename... Assignments>
struct update_list_data_t struct update_list_data_t
@ -51,7 +49,7 @@ namespace sqlpp
~update_list_data_t() = default; ~update_list_data_t() = default;
std::tuple<Assignments...> _assignments; std::tuple<Assignments...> _assignments;
typename vendor::interpretable_list_t<Database> _dynamic_assignments; typename interpretable_list_t<Database> _dynamic_assignments;
}; };
// UPDATE ASSIGNMENTS // UPDATE ASSIGNMENTS
@ -196,7 +194,7 @@ namespace sqlpp
-> _new_statement_t<update_list_t<_database_t, Args...>> -> _new_statement_t<update_list_t<_database_t, Args...>>
{ {
static_assert(not std::is_same<_database_t, void>::value, "dynamic_set must not be called in a static statement"); static_assert(not std::is_same<_database_t, void>::value, "dynamic_set must not be called in a static statement");
return { *static_cast<typename Policies::_statement_t*>(this), vendor::update_list_data_t<_database_t, Args...>{args...} }; return { *static_cast<typename Policies::_statement_t*>(this), update_list_data_t<_database_t, Args...>{args...} };
} }
}; };
}; };
@ -217,7 +215,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
} }
#endif #endif

View File

@ -35,8 +35,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
// USING DATA // USING DATA
template<typename Database, typename... Tables> template<typename Database, typename... Tables>
struct using_data_t struct using_data_t
@ -52,7 +50,7 @@ namespace sqlpp
~using_data_t() = default; ~using_data_t() = default;
std::tuple<Tables...> _tables; std::tuple<Tables...> _tables;
vendor::interpretable_list_t<Database> _dynamic_tables; interpretable_list_t<Database> _dynamic_tables;
}; };
// USING // USING
@ -201,7 +199,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
} }
#endif #endif

View File

@ -32,10 +32,7 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
template<typename T> template<typename T>
using value_type_t = value_type_of<wrap_operand_t<T>>; using value_type_t = value_type_of<wrap_operand_t<T>>;
}
} }
#endif #endif

View File

@ -63,8 +63,6 @@ namespace sqlpp
std::string _name; std::string _name;
}; };
namespace vendor
{
template<typename Context> template<typename Context>
struct serializer_t<Context, verbatim_table_t> struct serializer_t<Context, verbatim_table_t>
{ {
@ -76,7 +74,6 @@ namespace sqlpp
return context; return context;
} }
}; };
}
verbatim_table_t verbatim_table(std::string name) verbatim_table_t verbatim_table(std::string name)

View File

@ -36,8 +36,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
// WHERE DATA // WHERE DATA
template<typename Database, typename... Expressions> template<typename Database, typename... Expressions>
struct where_data_t struct where_data_t
@ -53,7 +51,7 @@ namespace sqlpp
~where_data_t() = default; ~where_data_t() = default;
std::tuple<Expressions...> _expressions; std::tuple<Expressions...> _expressions;
vendor::interpretable_list_t<Database> _dynamic_expressions; interpretable_list_t<Database> _dynamic_expressions;
}; };
// WHERE(EXPR) // WHERE(EXPR)
@ -271,7 +269,6 @@ namespace sqlpp
} }
}; };
}
} }
#endif #endif

View File

@ -41,8 +41,6 @@ namespace sqlpp
struct text; struct text;
} }
namespace vendor
{
struct boolean_operand struct boolean_operand
{ {
using _traits = make_traits<::sqlpp::detail::boolean, ::sqlpp::tag::expression, ::sqlpp::tag::wrapped_value>; using _traits = make_traits<::sqlpp::detail::boolean, ::sqlpp::tag::expression, ::sqlpp::tag::wrapped_value>;
@ -231,7 +229,6 @@ namespace sqlpp
template<typename T> template<typename T>
using wrap_operand_t = typename wrap_operand<T>::type; using wrap_operand_t = typename wrap_operand<T>::type;
}
} }
#endif #endif

View File

@ -31,8 +31,6 @@
namespace sqlpp namespace sqlpp
{ {
namespace vendor
{
namespace detail namespace detail
{ {
// A template that always returns false // A template that always returns false
@ -46,6 +44,5 @@ namespace sqlpp
} }
template<typename... T> template<typename... T>
using wrong_t = typename detail::wrong<T...>::type; using wrong_t = typename detail::wrong<T...>::type;
}
} }
#endif #endif