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;
};
namespace vendor
{
template<typename Context, typename Expression, typename AliasProvider>
struct serializer_t<Context, expression_alias_t<Expression, AliasProvider>>
{
@ -63,7 +61,6 @@ namespace sqlpp
}
};
}
}
#endif

View File

@ -51,8 +51,6 @@ namespace sqlpp
return {};
}
namespace vendor
{
template<typename Context, typename 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");
}
};
}
}

View File

@ -32,8 +32,6 @@
namespace sqlpp
{
namespace vendor
{
template<typename Select>
struct any_t
{
@ -64,14 +62,11 @@ namespace sqlpp
Select _select;
};
}
namespace vendor
{
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)
{
@ -83,15 +78,14 @@ namespace sqlpp
};
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_expression_t<vendor::wrap_operand_t<T>>::value, "any() requires a single column 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<wrap_operand_t<T>>::value, "any() requires a single column select expression as argument");
// FIXME: can we accept non-values like NULL here?
return { t };
}
}
}
#endif

View File

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

View File

@ -31,8 +31,6 @@
namespace sqlpp
{
namespace vendor
{
template<typename Flag, typename Expr>
struct avg_t: public floating_point::template expression_operators<avg_t<Flag, Expr>>,
public alias_operators<avg_t<Flag, Expr>>
@ -67,14 +65,11 @@ namespace sqlpp
Expr _expr;
};
}
namespace vendor
{
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)
{
@ -89,19 +84,18 @@ namespace sqlpp
return context;
}
};
}
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 };
}
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 };
}

View File

@ -52,65 +52,65 @@ namespace sqlpp
};
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");
return { *static_cast<const Base*>(this), rhs{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");
return { *static_cast<const Base*>(this), rhs{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");
return { *static_cast<const Base*>(this), rhs{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");
return { *static_cast<const Base*>(this), rhs{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");
return { *static_cast<const Base*>(this), rhs{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");
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) };
}
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) };
}
@ -127,17 +127,17 @@ namespace sqlpp
// Hint: use value_list wrapper for containers...
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");
return { *static_cast<const Base*>(this), vendor::wrap_operand_t<T>{t}... };
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), wrap_operand_t<T>{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");
return { *static_cast<const Base*>(this), vendor::wrap_operand_t<T>{t}... };
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), wrap_operand_t<T>{t}... };
}
};

View File

@ -184,24 +184,24 @@ namespace sqlpp
struct expression_operators: public basic_expression_operators<Base, is_boolean_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");
return { *static_cast<const Base*>(this), rhs{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");
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) };
}

View File

@ -81,30 +81,28 @@ namespace sqlpp
}
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");
return { *this, rhs{t} };
}
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");
return { *this, {} };
}
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, {} };
}
};
namespace vendor
{
template<typename Context, typename... Args>
struct serializer_t<Context, column_t<Args...>>
{
@ -117,7 +115,6 @@ namespace sqlpp
}
};
}
}
#endif

View File

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

View File

@ -32,8 +32,6 @@
namespace sqlpp
{
namespace vendor
{
template<typename Flag, typename Expr>
struct count_t: public sqlpp::detail::integral::template expression_operators<count_t<Flag, Expr>>,
public alias_operators<count_t<Flag, Expr>>
@ -68,14 +66,11 @@ namespace sqlpp
Expr _expr;
};
}
namespace vendor
{
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)
{
@ -90,19 +85,18 @@ namespace sqlpp
return context;
}
};
}
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 };
}
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 };
}

View File

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

View File

@ -57,7 +57,7 @@ namespace sqlpp
template<template<typename, typename...> class Target, typename First, typename T>
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>

View File

@ -73,7 +73,7 @@ namespace sqlpp
template<typename E, typename SET>
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>
@ -85,7 +85,7 @@ namespace sqlpp
template<typename L, typename R>
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>
@ -100,7 +100,7 @@ namespace sqlpp
template<typename L, typename R>
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>
@ -118,7 +118,7 @@ namespace sqlpp
template<typename L, typename R>
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>
@ -174,7 +174,7 @@ namespace sqlpp
template<typename... T>
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<>
@ -197,7 +197,7 @@ namespace sqlpp
template<typename Minuend, typename Subtrahend>
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>

View File

@ -31,8 +31,6 @@
namespace sqlpp
{
namespace vendor
{
template<typename Select>
struct exists_t: public boolean::template expression_operators<exists_t<Select>>,
public alias_operators<exists_t<Select>>
@ -66,14 +64,11 @@ namespace sqlpp
Select _select;
};
}
namespace vendor
{
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)
{
@ -83,13 +78,12 @@ namespace sqlpp
return context;
}
};
}
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 };
}

View File

@ -37,8 +37,6 @@
namespace sqlpp
{
namespace vendor
{
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>>,
public alias_operators<binary_expression_t<Lhs, op::equal_to, Rhs>>
@ -236,7 +234,6 @@ namespace sqlpp
return context;
}
};
}
}
#endif

View File

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

View File

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

View File

@ -31,8 +31,6 @@
namespace sqlpp
{
namespace vendor
{
template<typename NameType, typename ValueType, bool TrivialValueIsNull>
struct field_t
{
@ -67,7 +65,6 @@ namespace sqlpp
template<typename NamedExpr>
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>
{
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");
return { *static_cast<const Base*>(this), rhs{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");
return { *static_cast<const Base*>(this), rhs{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} };
}
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} };
}
vendor::unary_plus_t<floating_point, Base> operator +() const
unary_plus_t<floating_point, Base> operator +() const
{
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) };
}
@ -233,36 +233,36 @@ namespace sqlpp
struct column_operators
{
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");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{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");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{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");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{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");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } };

View File

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

View File

@ -46,11 +46,11 @@
namespace sqlpp
{
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 _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 };
}
@ -71,8 +71,6 @@ namespace sqlpp
std::string _verbatim;
};
namespace vendor
{
template<typename Context, typename ValueType>
struct serializer_t<Context, verbatim_t<ValueType>>
{
@ -84,7 +82,6 @@ namespace sqlpp
return context;
}
};
}
template<typename ValueType, typename StringType>
auto verbatim(StringType s) -> verbatim_t<ValueType>
@ -104,7 +101,7 @@ namespace sqlpp
template<typename Container>
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 _container_t = Container;
@ -122,8 +119,6 @@ namespace sqlpp
_container_t _container;
};
namespace vendor
{
template<typename Context, typename Container>
struct serializer_t<Context, value_list_t<Container>>
{
@ -144,12 +139,11 @@ namespace sqlpp
return context;
}
};
}
template<typename 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 };
}

View File

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

View File

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

View File

@ -34,8 +34,6 @@
namespace sqlpp
{
namespace vendor
{
template<bool NotInverted, typename Operand, typename... Args>
struct in_t: public boolean::template expression_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>
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)
{
@ -85,7 +83,6 @@ namespace sqlpp
return context;
}
};
}
}

View File

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

View File

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

View File

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

View File

@ -37,8 +37,6 @@
namespace sqlpp
{
namespace vendor
{
struct insert_default_values_data_t
{};
@ -98,8 +96,8 @@ namespace sqlpp
std::tuple<simple_column_t<typename Assignments::_column_t>...> _columns;
std::tuple<typename Assignments::_value_t...> _values;
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;
typename vendor::interpretable_list_t<Database> _dynamic_values;
interpretable_list_t<Database> _dynamic_columns;
interpretable_list_t<Database> _dynamic_values;
};
template<typename Database, typename... Assignments>
@ -218,7 +216,7 @@ namespace sqlpp
~column_list_data_t() = default;
#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::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");
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()");
@ -252,7 +250,7 @@ namespace sqlpp
void add(Assignments... 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>;
static_assert(_args_correct::value, "add_values() arguments do not match columns() arguments");
@ -267,7 +265,7 @@ namespace sqlpp
template<typename... 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>
@ -373,7 +371,7 @@ namespace sqlpp
-> _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");
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

View File

@ -186,56 +186,56 @@ namespace sqlpp
struct expression_operators: public basic_expression_operators<Base, is_numeric_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");
return { *static_cast<const Base*>(this), {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");
return { *static_cast<const Base*>(this), {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");
return { *static_cast<const Base*>(this), {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");
return { *static_cast<const Base*>(this), {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");
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) };
}
vendor::unary_minus_t<integral, Base> operator -() const
unary_minus_t<integral, Base> operator -() const
{
return { *static_cast<const Base*>(this) };
}
@ -245,36 +245,36 @@ namespace sqlpp
struct column_operators
{
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");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{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");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{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");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{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");
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>
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 vendor
{
template<typename Db>
struct interpretable_t
{
@ -125,7 +123,6 @@ namespace sqlpp
}
};
}
}
#endif

View File

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

View File

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

View File

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

View File

@ -33,8 +33,6 @@
namespace sqlpp
{
namespace vendor
{
template<bool NotInverted, typename Operand>
struct is_null_t: public boolean::template expression_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>
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)
{
@ -84,7 +82,6 @@ namespace sqlpp
return context;
}
};
}
}

View File

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

View File

@ -74,7 +74,7 @@ namespace sqlpp
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
{
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<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(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");
@ -96,7 +96,7 @@ namespace sqlpp
auto on(Expr... 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,
_rhs,
{std::tuple<Expr...>{expr...}}
@ -106,35 +106,35 @@ namespace sqlpp
template<typename 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 };
}
template<typename 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 };
}
template<typename 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 };
}
template<typename 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 };
}
template<typename 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 };
}
@ -143,8 +143,6 @@ namespace sqlpp
On _on;
};
namespace vendor
{
template<typename Context, typename JoinType, typename Lhs, typename Rhs, typename 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_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);
context << JoinType::_name;
context << " JOIN ";
@ -162,7 +160,6 @@ namespace sqlpp
}
};
}
}
#endif

View File

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

View File

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

View File

@ -31,8 +31,6 @@
namespace sqlpp
{
namespace vendor
{
template<typename Expr>
struct max_t: public value_type_of<Expr>::template expression_operators<max_t<Expr>>,
public alias_operators<max_t<Expr>>
@ -66,14 +64,11 @@ namespace sqlpp
Expr _expr;
};
}
namespace vendor
{
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)
{
@ -83,12 +78,11 @@ namespace sqlpp
return context;
}
};
}
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 };
}

View File

@ -31,8 +31,6 @@
namespace sqlpp
{
namespace vendor
{
template<typename Expr>
struct min_t: public value_type_of<Expr>::template expression_operators<min_t<Expr>>,
public alias_operators<min_t<Expr>>
@ -66,14 +64,11 @@ namespace sqlpp
Expr _expr;
};
}
namespace vendor
{
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)
{
@ -83,12 +78,11 @@ namespace sqlpp
return context;
}
};
}
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 };
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -53,11 +53,9 @@ namespace sqlpp
}
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>
struct serializer_t<Context, on_t<Database, Expr...>>
{
@ -76,7 +74,6 @@ namespace sqlpp
}
};
}
}
#endif

View File

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

View File

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

View File

@ -37,7 +37,7 @@ namespace sqlpp
template<typename 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>

View File

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

View File

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

View File

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

View File

@ -59,13 +59,11 @@ namespace sqlpp
};
}
namespace vendor
{
template<typename Db>
struct dynamic_select_column_list
{
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;
template<typename Expr>
@ -311,18 +309,15 @@ namespace sqlpp
};
};
}
namespace detail
{
template<typename Database, typename... Columns>
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>())...))>;
}
namespace vendor
{
struct no_select_column_list_t
{
using _traits = make_traits<no_value_t, ::sqlpp::tag::noop, ::sqlpp::tag::missing>;
@ -401,7 +396,6 @@ namespace sqlpp
}
};
}
}
#endif

View File

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

View File

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

View File

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

View File

@ -33,20 +33,17 @@ namespace sqlpp
{
template<typename T, typename 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>
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 vendor
{
template<typename Context, typename T, typename Enable = void>
struct serializer_t
{
@ -41,7 +39,6 @@ namespace sqlpp
static_assert(wrong_t<Context, T>::value, "missing serializer specialization");
}
};
}
}

View File

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

View File

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

View File

@ -32,8 +32,6 @@
namespace sqlpp
{
namespace vendor
{
template<typename Select>
struct some_t
{
@ -64,14 +62,11 @@ namespace sqlpp
Select _select;
};
}
namespace vendor
{
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)
{
@ -81,13 +76,12 @@ namespace sqlpp
return context;
}
};
}
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_expression_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<wrap_operand_t<T>>::value, "some() requires a single column select expression as argument");
return { t };
}

View File

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

View File

@ -61,7 +61,7 @@ namespace sqlpp
struct _policies_update_t
{
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>
@ -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_*()
>;
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>
{};
@ -181,8 +181,6 @@ namespace sqlpp
};
namespace vendor
{
template<typename Context, typename Database, typename... Policies>
struct serializer_t<Context, statement_t<Database, Policies...>>
{
@ -238,7 +236,6 @@ namespace sqlpp
};
};
}
}
#endif

View File

@ -31,8 +31,6 @@
namespace sqlpp
{
namespace vendor
{
template<typename Flag, typename Expr>
struct sum_t: public value_type_of<Expr>::template expression_operators<sum_t<Flag, Expr>>,
public alias_operators<sum_t<Flag, Expr>>
@ -67,14 +65,11 @@ namespace sqlpp
Expr _expr;
};
}
namespace vendor
{
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)
{
@ -89,19 +84,18 @@ namespace sqlpp
return context;
}
};
}
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 };
}
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 };
}

View File

@ -101,8 +101,6 @@ namespace sqlpp
}
};
namespace vendor
{
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>
{
@ -116,7 +114,6 @@ namespace sqlpp
};
}
}
#endif

View File

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

View File

@ -189,18 +189,18 @@ namespace sqlpp
struct expression_operators: public basic_expression_operators<Base, is_text_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");
return { *static_cast<const Base*>(this), {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()");
return { *static_cast<const Base*>(this), {t} };
@ -211,9 +211,9 @@ namespace sqlpp
struct column_operators
{
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");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } };

View File

@ -61,8 +61,6 @@ namespace sqlpp
Operand _value;
};
namespace vendor
{
template<typename Context, typename Operand>
struct serializer_t<Context, tvin_t<Operand>>
{
@ -70,10 +68,9 @@ namespace sqlpp
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>
struct maybe_tvin_t
@ -121,8 +118,6 @@ namespace sqlpp
typename tvin_t<Operand>::_operand_t _value;
};
namespace vendor
{
template<typename Context, typename Operand>
struct serializer_t<Context, maybe_tvin_t<Operand>>
{
@ -141,13 +136,12 @@ namespace sqlpp
return context;
}
};
}
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;
static_assert(std::is_same<_operand_t, vendor::text_operand>::value
using _operand_t = typename wrap_operand<Operand>::type;
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)");
return {{operand}};
}

View File

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

View File

@ -34,8 +34,6 @@
namespace sqlpp
{
namespace vendor
{
// UPDATE ASSIGNMENTS DATA
template<typename Database, typename... Assignments>
struct update_list_data_t
@ -51,7 +49,7 @@ namespace sqlpp
~update_list_data_t() = default;
std::tuple<Assignments...> _assignments;
typename vendor::interpretable_list_t<Database> _dynamic_assignments;
typename interpretable_list_t<Database> _dynamic_assignments;
};
// UPDATE ASSIGNMENTS
@ -196,7 +194,7 @@ namespace sqlpp
-> _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");
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;
}
};
}
}
#endif

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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