mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-01-03 19:50:30 -06:00
Added usage examples for count and exists
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user