minor refactoring in config

implement pagination
This commit is contained in:
Tina_Azure
2023-05-04 22:22:21 +02:00
parent 4720ffdad5
commit 8d2033b316
8 changed files with 132 additions and 19 deletions

View File

@ -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