Added usage examples for count and exists

This commit is contained in:
rbock
2015-05-13 07:58:43 +02:00
parent bcc085f819
commit 7b750bbe97

View File

@@ -195,6 +195,8 @@ int main()
static_assert(sqlpp::is_boolean_t<TT>::value, "type requirement");
static_assert(not sqlpp::is_numeric_t<TT>::value, "type requirement");
static_assert(not sqlpp::is_text_t<TT>::value, "type requirement");
if (db(select(exists(select(t.alpha).from(t).where(true)))).front().exists) { /* do something */ }
}
@@ -281,6 +283,8 @@ int main()
static_assert(sqlpp::is_numeric_t<TT>::value, "type requirement");
static_assert(sqlpp::is_integral_t<TT>::value, "type requirement");
static_assert(not sqlpp::is_floating_point_t<TT>::value, "type requirement");
if (db(select(count(t.alpha)).from(t).where(true)).front().count) { /* do something */ }
}
// Test max