Pgsql::Connection::connect functions now all report connection errors
by throwing exception.
This commit is contained in:
parent
05bca069e3
commit
c5f6da48ce
5 changed files with 35 additions and 39 deletions
|
|
@ -44,10 +44,10 @@ namespace Pgsql {
|
|||
Connection(Connection &&rhs);
|
||||
Connection& operator=(Connection &&rhs);
|
||||
|
||||
bool connect(const char *params);
|
||||
bool connect(const QString ¶ms)
|
||||
void connect(const char *params);
|
||||
void connect(const QString ¶ms)
|
||||
{
|
||||
return connect(params.toUtf8().data());
|
||||
connect(params.toStdString().c_str());
|
||||
}
|
||||
|
||||
void connect(const char *const * keywords, const char* const * values, int expand_dbname);
|
||||
|
|
@ -115,6 +115,7 @@ namespace Pgsql {
|
|||
PGconn *conn = nullptr;
|
||||
std::function<void(const PGresult *)> notifyReceiver;
|
||||
|
||||
static void testForConnectionError(PGconn *conn);
|
||||
void throwError(PGresult *result) const;
|
||||
static void notifyReceiveFunc(void *arg, const PGresult *result);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue