Allowing result fields to be used as arguments for queries

This commit is contained in:
rbock
2014-07-29 08:57:55 +02:00
parent 4be53d9933
commit b1f1de8a08
12 changed files with 158 additions and 15 deletions

View File

@@ -47,6 +47,20 @@ int main()
{
static_assert(sqlpp::can_be_null_t<decltype(row.alpha)>::value, "row.alpha can be null");
static_assert(sqlpp::null_is_trivial_value_t<decltype(row.alpha)>::value, "row.alpha interprets null_is_trivial");
static_assert(std::is_member_function_pointer<decltype(&decltype(row.alpha)::is_null)>::value, "Yikes");
using T = sqlpp::wrap_operand_t<decltype(row.alpha)>;
static_assert(sqlpp::can_be_null_t<T>::value, "row.alpha can be null");
static_assert(sqlpp::is_result_field_t<T>::value, "row.alpha can be null");
bool x = sqlpp::rhs_is_null(t.alpha == row.alpha);
bool y = sqlpp::rhs_is_trivial(t.alpha == row.alpha);
std::cerr << x << std::endl;
std::cerr << y << std::endl;
for (const auto& sub : db(select(all_of(t)).from(t).where(t.alpha == row.alpha)))
{
std::cerr << sub.alpha << std::endl;
}
}
sqlpp::select((t.alpha + 1).as(t.alpha)).flags(sqlpp::all).from(t);