Query, Explain and Cancel are going throught the asyncdbconnection now.

Todo: Notice processing and error reporting.
This commit is contained in:
Eelke Klein 2017-01-08 09:58:34 +01:00
parent fce51a7b7e
commit a36bf5f7f4
11 changed files with 335 additions and 217 deletions

View file

@ -129,15 +129,17 @@ namespace Pgsql {
class Canceller {
public:
Canceller() = default;
Canceller(PGcancel *c);
Canceller(const Canceller&) = delete;
Canceller& operator=(const Canceller&) = delete;
Canceller(Canceller&& rhs);
Canceller& operator=(Canceller&& rhs);
~Canceller();
void cancel();
bool cancel(std::string *error);
private:
PGcancel *m_cancel;
PGcancel *m_cancel = nullptr;
};
@ -187,12 +189,16 @@ namespace Pgsql {
}
bool sendQuery(const char * query);
bool sendQuery(const std::string &command)
{
return sendQuery(command.c_str());
}
bool sendQuery(const QString &command)
{
return sendQuery(command.toUtf8().data());
}
std::unique_ptr<Result> getResult();
std::shared_ptr<Result> getResult();
bool consumeInput();
bool isBusy();