mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-01-04 12:10:43 -06:00
Merge branch 'develop' of https://github.com/rbock/sqlpp11 into develop
This commit is contained in:
@@ -187,14 +187,19 @@ namespace sqlpp
|
||||
return {*static_cast<const Expr*>(this)};
|
||||
}
|
||||
|
||||
auto asc() const -> sort_order_t<Expr, sort_type::asc>
|
||||
auto asc() const -> sort_order_t<Expr>
|
||||
{
|
||||
return {*static_cast<const Expr*>(this)};
|
||||
return {*static_cast<const Expr*>(this), sort_type::asc};
|
||||
}
|
||||
|
||||
auto desc() const -> sort_order_t<Expr, sort_type::desc>
|
||||
auto desc() const -> sort_order_t<Expr>
|
||||
{
|
||||
return {*static_cast<const Expr*>(this)};
|
||||
return {*static_cast<const Expr*>(this), sort_type::desc};
|
||||
}
|
||||
|
||||
auto order(sort_type s) const -> sort_order_t<Expr>
|
||||
{
|
||||
return {*static_cast<const Expr*>(this), s};
|
||||
}
|
||||
|
||||
template <typename... T>
|
||||
|
||||
@@ -39,25 +39,26 @@ namespace sqlpp
|
||||
desc
|
||||
};
|
||||
|
||||
template <typename Expression, sort_type SortType>
|
||||
template <typename Expression>
|
||||
struct sort_order_t
|
||||
{
|
||||
using _traits = make_traits<no_value_t, tag::is_sort_order>;
|
||||
using _nodes = detail::type_vector<Expression>;
|
||||
|
||||
Expression _expression;
|
||||
sort_type _sort_type;
|
||||
};
|
||||
|
||||
template <typename Context, typename Expression, sort_type SortType>
|
||||
struct serializer_t<Context, sort_order_t<Expression, SortType>>
|
||||
template <typename Context, typename Expression>
|
||||
struct serializer_t<Context, sort_order_t<Expression>>
|
||||
{
|
||||
using _serialize_check = serialize_check_of<Context, Expression>;
|
||||
using T = sort_order_t<Expression, SortType>;
|
||||
using T = sort_order_t<Expression>;
|
||||
|
||||
static Context& _(const T& t, Context& context)
|
||||
{
|
||||
serialize_operand(t._expression, context);
|
||||
switch (SortType)
|
||||
switch (t._sort_type)
|
||||
{
|
||||
case sort_type::asc:
|
||||
context << " ASC";
|
||||
|
||||
Reference in New Issue
Block a user