mirror of
https://github.com/rbock/sqlpp11.git
synced 2025-12-17 18:44:37 -06:00
Fix missing wrap_operand in case/then/else_, #624
case(...).then(...).else_(7) can now be used.
This commit is contained in:
@@ -86,7 +86,7 @@ namespace sqlpp
|
||||
class case_then_t
|
||||
{
|
||||
template <typename Else>
|
||||
auto _else_impl(consistent_t /*unused*/, Else else_) -> case_t<When, Then, Else>
|
||||
auto _else_impl(consistent_t /*unused*/, Else else_) -> case_t<When, Then, wrap_operand_t<Else>>
|
||||
{
|
||||
return {_when, _then, else_};
|
||||
}
|
||||
|
||||
@@ -197,6 +197,12 @@ int Select(int, char*[])
|
||||
std::cerr << row.beta << std::endl;
|
||||
}
|
||||
|
||||
for (const auto& row :
|
||||
db(select(sqlpp::case_when(true).then(5).else_(7).as(t.beta)).from(t).unconditionally()))
|
||||
{
|
||||
std::cerr << row.beta << std::endl;
|
||||
}
|
||||
|
||||
for (const auto& row : db(select(all_of(t)).from(t).unconditionally()))
|
||||
{
|
||||
for_each_field(row, to_cerr{});
|
||||
|
||||
Reference in New Issue
Block a user