mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-01-05 12:40:40 -06:00
Allow result_t to have a size() function if DbResult has a size() function.
size() must be const, but can be arbitrary type. size() may be wrong after first next has been called
This commit is contained in:
@@ -65,9 +65,11 @@ namespace
|
||||
static_assert(not sqlpp::can_be_null_t<decltype(x.s)>::value, "constant non-null value can not be null");
|
||||
}
|
||||
{
|
||||
const auto& x = db(select(bar.alpha, foo.delta, bar.gamma, seven)
|
||||
auto&& result = db(select(bar.alpha, foo.delta, bar.gamma, seven)
|
||||
.from(bar.join(foo).on(foo.omega > bar.alpha))
|
||||
.unconditionally()).front();
|
||||
.unconditionally());
|
||||
const auto& x = result.front();
|
||||
static_assert(std::is_same<decltype(result.size()), size_t>::value, "db doesn't have size_t result_t.size() ");
|
||||
static_assert(sqlpp::can_be_null_t<decltype(x.alpha)>::value, "nullable value can always be null");
|
||||
static_assert(not sqlpp::can_be_null_t<decltype(x.gamma)>::value, "left side of (inner) join cannot be null");
|
||||
static_assert(not sqlpp::can_be_null_t<decltype(x.delta)>::value, "right side of (inner) join cannot be null");
|
||||
|
||||
Reference in New Issue
Block a user