Added getResultNoThrow as the AsyncDBCOnnection doesn't like exceptions.
This commit is contained in:
parent
43f8117bbd
commit
471139ba4d
3 changed files with 13 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ namespace Pgsql {
|
|||
bool sendQueryParams(const char * command, const Params ¶ms);
|
||||
|
||||
std::shared_ptr<Result> getResult();
|
||||
std::shared_ptr<Result> getResultNoThrow();
|
||||
|
||||
bool consumeInput();
|
||||
bool isBusy();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue