1 #ifndef EASYQTSQL_UTIL_H 2 #define EASYQTSQL_UTIL_H 29 #ifndef EASY_QT_SQL_MAIN 63 template<
typename Func>
87 template<
typename Func>
98 for (
int i = 0; i < start; ++i)
104 for (
int i = 0; i < count && res.
next(); ++i)
121 template<
typename Func>
124 return range(res, 0, topCount, f);
132 template<
typename Func>
135 return top(res, 1, f);
142 #endif // EASYQTSQL_UTIL_H static int range(QueryResult &res, int start, int count, Func &&f)
Applies function (lambda) f to count rows starting from start index.
Definition: EasyQtSql_Util.h:88
static int top(QueryResult &res, int topCount, Func &&f)
Applies function (lambda) f to topCount rows from res.
Definition: EasyQtSql_Util.h:122
Utility functions.
Definition: EasyQtSql_Util.h:54
bool isActive() const
Returns true if the query is active. An active QSqlQuery is one that has been exec()'d successfully b...
Definition: EasyQtSql_QueryResult.h:151
QSqlQuery wrapper with handy data fetch methods.
Definition: EasyQtSql_QueryResult.h:39
static int first(QueryResult &res, Func &&f)
Applies function (lambda) f to first result row.
Definition: EasyQtSql_Util.h:133
bool next()
Retrieves the next record in the result, if available, and positions the query on the retrieved recor...
Definition: EasyQtSql_QueryResult.h:60
static int each(QueryResult &res, Func &&f)
Applies function (lambda) f to each row in res.
Definition: EasyQtSql_Util.h:64