mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-15 20:31:16 +08:00
Fixed handling of IS NULL and IS NOT NULL expressions
This commit is contained in:
parent
c41a181ca9
commit
cf1dae396a
@ -127,12 +127,12 @@ namespace sqlpp
|
||||
return { *static_cast<const Base*>(this), std::forward<T>(t) };
|
||||
}
|
||||
|
||||
nary_expression_t<Base, is_null_> is_null() const
|
||||
null_expression_t<Base, is_null_> is_null() const
|
||||
{
|
||||
return { *static_cast<const Base*>(this) };
|
||||
}
|
||||
|
||||
nary_expression_t<Base, is_not_null_> is_not_null() const
|
||||
null_expression_t<Base, is_not_null_> is_not_null() const
|
||||
{
|
||||
return { *static_cast<const Base*>(this) };
|
||||
}
|
||||
@ -147,7 +147,7 @@ namespace sqlpp
|
||||
return { *static_cast<const Base*>(this) };
|
||||
}
|
||||
|
||||
// Hint: use wrappers for containers...
|
||||
// Hint: use value_list wrapper for containers...
|
||||
template<typename... T>
|
||||
nary_expression_t<Base, in_, typename Constraint<T>::type...> in(T&&... t) const
|
||||
{
|
||||
|
@ -172,6 +172,38 @@ namespace sqlpp
|
||||
Lhs _lhs;
|
||||
};
|
||||
|
||||
template<typename Lhs, typename O>
|
||||
struct null_expression_t: public O::_value_type::template operators<null_expression_t<Lhs, O>>
|
||||
{
|
||||
using _value_type = typename O::_value_type;
|
||||
|
||||
null_expression_t(Lhs&& l):
|
||||
_lhs(std::move(l))
|
||||
{}
|
||||
|
||||
null_expression_t(const Lhs& l):
|
||||
_lhs(l)
|
||||
{}
|
||||
|
||||
null_expression_t(const null_expression_t&) = default;
|
||||
null_expression_t(null_expression_t&&) = default;
|
||||
null_expression_t& operator=(const null_expression_t&) = default;
|
||||
null_expression_t& operator=(null_expression_t&&) = default;
|
||||
~null_expression_t() = default;
|
||||
|
||||
template<typename Db>
|
||||
void serialize(std::ostream& os, Db& db) const
|
||||
{
|
||||
os << "(";
|
||||
_lhs.serialize(os, db);
|
||||
os << ")";
|
||||
os << O::_name;
|
||||
}
|
||||
|
||||
private:
|
||||
Lhs _lhs;
|
||||
};
|
||||
|
||||
template<typename Lhs, typename O, typename... Rhs>
|
||||
struct nary_expression_t: public O::_value_type::template operators<nary_expression_t<Lhs, O, Rhs...>>
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user