minor refactoring in config
implement pagination
This commit is contained in:
@ -195,6 +195,30 @@ namespace Database {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Executes the SELECT_FREELANCERS_WITHCOMMISSIONSSTATE statement
|
||||
* Takes an open pqxx::connection
|
||||
*/
|
||||
pqxx::result executeStatement_SELECT_FREELANCERS_COUNT(pqxx::connection &connection) {
|
||||
pqxx::work work(connection);
|
||||
pqxx::result result = work.exec(SQL_Statement_SELECT_FREELANCERS_COUNT);
|
||||
work.commit();
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Executes the SELECT_FREELANCERS_WITHCOMMISSIONSSTATE_LIMITED_AND_OFFSET statement
|
||||
* Takes an open pqxx::connection the limit and the offset
|
||||
*/
|
||||
pqxx::result executePreparedStatement_SELECT_FREELANCERS_WITHCOMMISSIONSSTATE_LIMITED_AND_OFFSET(pqxx::connection &connection, int limit, int offset) {
|
||||
if (offset < 0)
|
||||
offset = 0;
|
||||
pqxx::work work(connection);
|
||||
pqxx::result result = work.exec_prepared(PREPARED_STATEMENT_SELECT_FREELANCERS_WITHCOMMISSIONSSTATE_LIMITED_AND_OFFSET, limit, offset);
|
||||
work.commit();
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Executes the PURGE_EXPIRED_FREELANCER_RESET_KEYS statement
|
||||
* Takes an open pqxx::connection
|
||||
|
Reference in New Issue
Block a user