Remove tvin

This was a special feature for a project I was working on long ago.
It provided implicit behavior for trivial value (0 or "") which were
supposed to be interpreted as NULL.
They led to `operator==` potentially being serialized as 'IS NULL'.

It makes more sense to introduce explicit helpers, e.g.

 - equal_or_is_null(col, optional)
 - not_equal_or_is_not_null(col, optional)
This commit is contained in:
Roland Bock
2021-07-11 12:47:13 +02:00
parent 35c2b9ec04
commit db0295a9d0
22 changed files with 14 additions and 286 deletions

View File

@@ -436,30 +436,5 @@ int Function(int, char* [])
static_assert(sqlpp::is_alias_t<T>::value, "type requirement");
}
// test tvin
{
static_assert(std::is_same<decltype(sqlpp::tvin(1)), sqlpp::tvin_arg_t<sqlpp::integral_operand>>::value,
"integral values are accepted and wrapped");
static_assert(std::is_same<decltype(sqlpp::tvin(false)), sqlpp::tvin_arg_t<sqlpp::boolean_operand>>::value,
"bool values are accepted and wrapped");
static_assert(std::is_same<decltype(sqlpp::tvin(0.17)), sqlpp::tvin_arg_t<sqlpp::floating_point_operand>>::value,
"float values are accepted and wrapped");
static_assert(std::is_same<decltype(sqlpp::tvin("test")), sqlpp::tvin_arg_t<sqlpp::text_operand>>::value,
"text values are accepted and wrapped");
for (const auto& row : db(select(all_of(t)).from(t).unconditionally()))
{
static_assert(std::is_same<decltype(sqlpp::tvin(row.alpha)),
sqlpp::tvin_arg_t<typename std::remove_const<decltype(row.alpha)>::type>>::value,
"result fields are accepted and not wrapped");
static_assert(std::is_same<decltype(sqlpp::tvin(row.beta)),
sqlpp::tvin_arg_t<typename std::remove_const<decltype(row.beta)>::type>>::value,
"result fields are accepted and not wrapped");
static_assert(std::is_same<decltype(sqlpp::tvin(row.gamma)),
sqlpp::tvin_arg_t<typename std::remove_const<decltype(row.gamma)>::type>>::value,
"result fields are accepted and not wrapped");
}
}
return 0;
}