Added getResultNoThrow as the AsyncDBCOnnection doesn't like exceptions.

This commit is contained in:
eelke 2018-12-23 12:39:53 +01:00
parent 43f8117bbd
commit 471139ba4d
3 changed files with 13 additions and 1 deletions

View file

@ -159,6 +159,17 @@ std::shared_ptr<Result> Connection::getResult()
}
}
std::shared_ptr<Result> Connection::getResultNoThrow()
{
PGresult *r = PQgetResult(conn);
if (r) {
return std::make_shared<Result>(r);
}
else {
return nullptr;
}
}
bool Connection::consumeInput()
{
int res = PQconsumeInput(conn);

View file

@ -98,6 +98,7 @@ namespace Pgsql {
bool sendQueryParams(const char * command, const Params &params);
std::shared_ptr<Result> getResult();
std::shared_ptr<Result> getResultNoThrow();
bool consumeInput();
bool isBusy();