interpret handles order_by(), limit() and offset()

This commit is contained in:
rbock
2014-01-13 06:24:27 +01:00
parent f21860e5c5
commit c03ef1b0b1
5 changed files with 67 additions and 61 deletions
+12 -14
View File
@@ -37,26 +37,24 @@ namespace sqlpp
struct offset_t
{
using _is_offset = std::true_type;
using _parameter_tuple_t = std::tuple<Offset>;
static_assert(std::is_integral<Offset>::value
or (is_parameter_t<Offset>::value and is_numeric_t<Offset>::value), "offset requires an integral value or integral parameter");
template<typename Db>
void serialize(std::ostream& os, Db& db) const
{
os << " OFFSET " << _offset;
}
size_t _set_parameter_index(size_t index)
{
index = set_parameter_index(_offset, index);
return index;
}
Offset _offset;
};
template<typename Context, typename Offset>
struct interpreter_t<Context, offset_t<Offset>>
{
using T = offset_t<Offset>;
static Context& _(const T& t, Context& context)
{
context << "OFFSET " << t._offset;
return context;
}
};
struct dynamic_offset_t
{
using _is_offset = std::true_type;