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:
parent
060d59125c
commit
09d220541e
@ -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>>
|
||||
{
|
||||
@ -64,6 +62,5 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -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");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -31,8 +31,6 @@
|
||||
#include <sqlpp11/detail/type_set.h>
|
||||
|
||||
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
|
||||
|
@ -35,8 +35,6 @@
|
||||
#include <sqlpp11/simple_column.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<typename T, typename Enable = void>
|
||||
struct is_trivial_t
|
||||
@ -159,6 +157,5 @@ namespace sqlpp
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -30,8 +30,6 @@
|
||||
#include <sqlpp11/type_traits.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<typename Flag, typename Expr>
|
||||
struct avg_t: public floating_point::template expression_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 };
|
||||
}
|
||||
|
||||
|
@ -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}... };
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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) };
|
||||
}
|
||||
|
@ -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...>>
|
||||
{
|
||||
@ -118,6 +116,5 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -32,8 +32,6 @@
|
||||
#include <sqlpp11/detail/logic.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
// FIXME: Remove First, inherit from text_t
|
||||
template<typename First, typename... Args>
|
||||
@ -82,6 +80,5 @@ namespace sqlpp
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -31,8 +31,6 @@
|
||||
#include <sqlpp11/integral.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<typename Flag, typename Expr>
|
||||
struct count_t: public sqlpp::detail::integral::template expression_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 };
|
||||
}
|
||||
|
||||
|
@ -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 = {};
|
||||
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -30,8 +30,6 @@
|
||||
#include <sqlpp11/boolean.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<typename Select>
|
||||
struct exists_t: public boolean::template expression_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 };
|
||||
}
|
||||
|
||||
|
@ -36,8 +36,6 @@
|
||||
#include <sqlpp11/wrap_operand.h>
|
||||
|
||||
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>>,
|
||||
@ -237,6 +235,5 @@ namespace sqlpp
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -36,8 +36,6 @@ namespace sqlpp
|
||||
struct floating_point;
|
||||
}
|
||||
|
||||
namespace vendor
|
||||
{
|
||||
namespace op
|
||||
{
|
||||
struct less
|
||||
@ -194,6 +192,5 @@ namespace sqlpp
|
||||
using unary_minus_t = unary_expression_t<op::unary_minus<ValueType>, Rhs>;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -32,8 +32,6 @@
|
||||
#include <sqlpp11/policy_update.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<typename... Tables>
|
||||
struct extra_tables_data_t
|
||||
@ -165,6 +163,5 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -30,8 +30,6 @@
|
||||
#include <sqlpp11/multi_column.h>
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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} } };
|
||||
|
@ -34,8 +34,6 @@
|
||||
#include <sqlpp11/policy_update.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
// FROM DATA
|
||||
template<typename Database, typename... Tables>
|
||||
@ -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
|
||||
@ -207,6 +205,5 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -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 };
|
||||
}
|
||||
|
||||
|
@ -36,8 +36,6 @@
|
||||
#include <sqlpp11/detail/logic.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
// GROUP BY DATA
|
||||
template<typename Database, typename... Expressions>
|
||||
@ -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
|
||||
@ -209,6 +207,5 @@ namespace sqlpp
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -35,8 +35,6 @@
|
||||
#include <sqlpp11/detail/logic.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
// HAVING DATA
|
||||
template<typename Database, typename... Expressions>
|
||||
@ -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
|
||||
@ -207,6 +205,5 @@ namespace sqlpp
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -33,8 +33,6 @@
|
||||
#include <sqlpp11/detail/type_set.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<bool NotInverted, typename Operand, typename... Args>
|
||||
struct in_t: public boolean::template expression_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;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -28,12 +28,9 @@
|
||||
#define SQLPP_IN_FWD_H
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<bool NotInverted, typename Operand, typename... Args>
|
||||
struct in_t;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
|
@ -35,8 +35,6 @@
|
||||
#include <sqlpp11/detail/type_set.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
@ -119,6 +117,5 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -36,8 +36,6 @@
|
||||
#include <sqlpp11/simple_column.h>
|
||||
|
||||
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...} };
|
||||
}
|
||||
};
|
||||
};
|
||||
@ -448,6 +446,5 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -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} } };
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -34,8 +34,6 @@
|
||||
#include <sqlpp11/interpret.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<typename Db>
|
||||
struct interpretable_t
|
||||
@ -126,6 +124,5 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -31,8 +31,6 @@
|
||||
#include <sqlpp11/interpretable.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<typename Db>
|
||||
struct interpretable_list_t
|
||||
@ -114,6 +112,5 @@ namespace sqlpp
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -30,8 +30,6 @@
|
||||
#include <sqlpp11/wrong.h>
|
||||
|
||||
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");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -33,8 +33,6 @@
|
||||
#include <sqlpp11/detail/type_set.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
// A SINGLE TABLE DATA
|
||||
template<typename Database, typename Table>
|
||||
@ -193,6 +191,5 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -32,8 +32,6 @@
|
||||
#include <sqlpp11/detail/type_set.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<bool NotInverted, typename Operand>
|
||||
struct is_null_t: public boolean::template expression_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;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -28,12 +28,9 @@
|
||||
#define SQLPP_IS_NULL_FWD_H
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<bool NotInverted, typename Operand>
|
||||
struct is_null_t;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -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 ";
|
||||
@ -163,6 +161,5 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -32,8 +32,6 @@
|
||||
#include <sqlpp11/detail/type_set.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<typename Operand, typename Pattern>
|
||||
struct like_t: public boolean::template expression_operators<like_t<Operand, Pattern>>,
|
||||
@ -85,6 +83,5 @@ namespace sqlpp
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -32,8 +32,6 @@
|
||||
#include <sqlpp11/detail/type_set.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
// LIMIT DATA
|
||||
template<typename Limit>
|
||||
@ -255,6 +253,5 @@ namespace sqlpp
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -30,8 +30,6 @@
|
||||
#include <sqlpp11/type_traits.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<typename Expr>
|
||||
struct max_t: public value_type_of<Expr>::template expression_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 };
|
||||
}
|
||||
|
||||
|
@ -30,8 +30,6 @@
|
||||
#include <sqlpp11/type_traits.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<typename Expr>
|
||||
struct min_t: public value_type_of<Expr>::template expression_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 };
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -32,8 +32,6 @@
|
||||
#include <sqlpp11/parameter_list.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<typename Db>
|
||||
struct named_interpretable_t
|
||||
@ -133,7 +131,6 @@ namespace sqlpp
|
||||
return context;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -32,8 +32,6 @@
|
||||
#include <sqlpp11/serializer.h>
|
||||
|
||||
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
|
||||
|
@ -28,13 +28,10 @@
|
||||
#define SQLPP_NOOP_FWD_H
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
struct noop;
|
||||
|
||||
template<typename T>
|
||||
struct is_noop;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -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 = {};
|
||||
|
||||
|
@ -32,8 +32,6 @@
|
||||
#include <sqlpp11/detail/type_set.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
// OFFSET DATA
|
||||
template<typename Offset>
|
||||
@ -265,6 +263,5 @@ namespace sqlpp
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -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...>>
|
||||
{
|
||||
@ -77,6 +75,5 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -36,8 +36,6 @@
|
||||
#include <sqlpp11/detail/type_set.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
// ORDER BY DATA
|
||||
template<typename Database, typename... Expressions>
|
||||
@ -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
|
||||
@ -209,6 +207,5 @@ namespace sqlpp
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -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");
|
||||
|
@ -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>
|
||||
|
@ -30,8 +30,6 @@
|
||||
#include <sqlpp11/wrong.h>
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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...>>;
|
||||
|
@ -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
|
||||
|
@ -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>;
|
||||
@ -402,6 +397,5 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -35,8 +35,6 @@
|
||||
#include <sqlpp11/policy_update.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
// SELECTED FLAGS DATA
|
||||
template<typename Database, typename... Flags>
|
||||
@ -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
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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...>>
|
||||
{
|
||||
@ -87,6 +85,5 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -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);
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -30,8 +30,6 @@
|
||||
#include <sqlpp11/wrong.h>
|
||||
|
||||
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");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -30,8 +30,6 @@
|
||||
#include <sqlpp11/serializer.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<typename Column>
|
||||
struct simple_column_t
|
||||
@ -57,6 +55,5 @@ namespace sqlpp
|
||||
return {c};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -33,8 +33,6 @@
|
||||
#include <sqlpp11/detail/type_set.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
// A SINGLE TABLE DATA
|
||||
template<typename Database, typename Table>
|
||||
@ -212,6 +210,5 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -31,8 +31,6 @@
|
||||
#include <sqlpp11/detail/type_set.h>
|
||||
|
||||
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 };
|
||||
}
|
||||
|
||||
|
@ -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>>
|
||||
{
|
||||
@ -70,6 +68,5 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -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...>>
|
||||
{
|
||||
@ -239,7 +237,6 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -30,8 +30,6 @@
|
||||
#include <sqlpp11/type_traits.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<typename Flag, typename Expr>
|
||||
struct sum_t: public value_type_of<Expr>::template expression_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 };
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
{
|
||||
@ -117,7 +115,6 @@ namespace sqlpp
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -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...>>
|
||||
{
|
||||
@ -78,7 +76,6 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -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} } };
|
||||
|
@ -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}};
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -33,8 +33,6 @@
|
||||
#include <sqlpp11/interpretable_list.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
// UPDATE ASSIGNMENTS DATA
|
||||
template<typename Database, typename... Assignments>
|
||||
@ -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...} };
|
||||
}
|
||||
};
|
||||
};
|
||||
@ -218,6 +216,5 @@ namespace sqlpp
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -34,8 +34,6 @@
|
||||
#include <sqlpp11/policy_update.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
// USING DATA
|
||||
template<typename Database, typename... Tables>
|
||||
@ -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
|
||||
@ -202,6 +200,5 @@ namespace sqlpp
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -31,11 +31,8 @@
|
||||
#include <sqlpp11/wrap_operand.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
template<typename T>
|
||||
using value_type_t = value_type_of<wrap_operand_t<T>>;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -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)
|
||||
|
@ -35,8 +35,6 @@
|
||||
#include <sqlpp11/detail/logic.h>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
// WHERE DATA
|
||||
template<typename Database, typename... Expressions>
|
||||
@ -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)
|
||||
@ -272,6 +270,5 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -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>;
|
||||
@ -232,6 +230,5 @@ namespace sqlpp
|
||||
using wrap_operand_t = typename wrap_operand<T>::type;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -30,8 +30,6 @@
|
||||
#include <type_traits>
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
namespace vendor
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
@ -47,5 +45,4 @@ namespace sqlpp
|
||||
template<typename... T>
|
||||
using wrong_t = typename detail::wrong<T...>::type;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user