Double clicking a table now opens a CRUD page for that table however data cannot be changed yet thought it will display an editbox.

This commit is contained in:
eelke 2018-01-09 20:39:43 +01:00
parent abd4020ddf
commit 2ba27178a2
13 changed files with 288 additions and 33 deletions

View file

@ -48,11 +48,28 @@ public:
bool send(const std::string &command, on_result_callback on_result);
bool send(const std::string &command, Pgsql::Params params, on_result_callback on_result);
/** This version of send uses the signal onQueryResult and onQueryError to report back
* the completion of the query.
*/
bool send(const std::string &command, Pgsql::Params params = Pgsql::Params())
{
return send(command, params, [this] (Expected<std::shared_ptr<Pgsql::Result>> res, qint64) {
if (res.valid()) {
emit onQueryResult(res.get());
}
else {
emit onQueryError();
}
});
}
bool cancel();
signals:
void onStateChanged(ASyncDBConnection::State state);
void onNotice(Pgsql::ErrorDetails notice);
void onQueryResult(std::shared_ptr<Pgsql::Result> result);
void onQueryError();
private:
Pgsql::Connection m_connection;
@ -71,6 +88,7 @@ private:
Q_DECLARE_METATYPE(ASyncDBConnection::State);
Q_DECLARE_METATYPE(Pgsql::ErrorDetails);
Q_DECLARE_METATYPE(std::shared_ptr<Pgsql::Result>);
#endif // ASYNCDBCONNECTION_H