diff --git a/include/sqlpp11/in.h b/include/sqlpp11/in.h index 9628ee84..28d9901f 100644 --- a/include/sqlpp11/in.h +++ b/include/sqlpp11/in.h @@ -95,6 +95,33 @@ namespace sqlpp } }; + template + struct value_list_t; + + template + struct serializer_t>> + { + using _serialize_check = serialize_check_of>; + using T = in_t>; + + static Context& _(const T& t, Context& context) + { + const auto& value_list = std::get<0>(t._args); + if (value_list._container.empty()) + { + context << " 'operand in empty list' = 'false' "; + } + else + { + serialize(t._operand, context); + context << " IN("; + serialize(value_list, context); + context << ')'; + } + return context; + } + }; + } #endif diff --git a/include/sqlpp11/not_in.h b/include/sqlpp11/not_in.h index c42edc70..d230d815 100644 --- a/include/sqlpp11/not_in.h +++ b/include/sqlpp11/not_in.h @@ -95,6 +95,34 @@ namespace sqlpp } }; + template + struct value_list_t; + + template + struct serializer_t>> + { + using _serialize_check = serialize_check_of>; + using T = not_in_t>; + + static Context& _(const T& t, Context& context) + { + const auto& value_list = std::get<0>(t._args); + if (value_list._container.empty()) + { + context << " 'operand not in empty list' != 'false' "; + } + else + { + serialize(t._operand, context); + context << " NOT IN("; + serialize(value_list, context); + context << ')'; + } + return context; + } + }; + + } #endif