mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-01-10 07:02:11 -06:00
Allowing result fields to be used as arguments for queries
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user