Added explain functionality.
Uses json format with jsoncpp as a parser. Then show it in a QTreeView. Shows inclusive/exclusive times like explain.despesz does. Also a similar coloring scheme as applied.
This commit is contained in:
parent
0d30dc9080
commit
8af6bc4ac5
14 changed files with 9089 additions and 33 deletions
12
mainwindow.h
12
mainwindow.h
|
|
@ -7,7 +7,9 @@
|
|||
#include <future>
|
||||
#include "PgsqlConn.h"
|
||||
|
||||
class ExplainRoot;
|
||||
class QueryResultModel;
|
||||
class QueryExplainModel;
|
||||
class SqlHighlighter;
|
||||
|
||||
namespace Ui {
|
||||
|
|
@ -34,8 +36,11 @@ private:
|
|||
|
||||
std::unique_ptr<Pgsql::Connection> connection;
|
||||
std::unique_ptr<QueryResultModel> resultModel;
|
||||
std::unique_ptr<QueryExplainModel> explainModel;
|
||||
|
||||
Pgsql::Canceller queryCancel;
|
||||
std::future<Pgsql::Result> queryFuture;
|
||||
std::future<std::unique_ptr<ExplainRoot>> explainFuture;
|
||||
|
||||
struct {
|
||||
std::unique_ptr<QSocketNotifier> notifier;
|
||||
|
|
@ -47,13 +52,20 @@ private:
|
|||
// std::unique_ptr<QSocketNotifier> notifierWrite;
|
||||
// } queryState;
|
||||
|
||||
void processNotice(const PGresult *result);
|
||||
private slots:
|
||||
|
||||
void startConnect();
|
||||
|
||||
void performQuery();
|
||||
void performExplain();
|
||||
void socket_activate_connect(int socket);
|
||||
void query_ready();
|
||||
void explain_ready();
|
||||
void cancel_query();
|
||||
void receiveNotice(Pgsql::ErrorDetails notice);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue