[x] Given a successful connection to a TypeDB database, and given a valid TypeQL Match query in the selected tab of the code editor, the Run button should:
Open a data session
Open a read transaction in that session
Execute the query in that transaction
Render the results in the Graph tab of the Results pane
Close the session
NOTE: We won't validate the query just yet - but this will be needed in order to support other query types, such as Insert.
NOTE: In the future we might consider keeping the Session alive for some time - say up to a minute, and if a Session is open in the current tab when executing a query, reuse it, else reopen it.
[x] While no query is running, the left-hand side of the status bar should read "Ready". We call this the principal status. When a query is running, the principal status should be changed to "Running Match query..."
[x] When a query is run, a timer should appear on the right of the status bar indicating how long the query has been running. This timer should stop - and stick around - when the query finishes.
[x] When a query is run, an answer count should appear to the right of the timer: "0 answers". This should be adjusted as answers are fetched, and should stick around when the query finishes.
[x] When a query is run, the "Run" button should change to "Cancel".
[x] Clicking "Cancel" should stop the query, append "Query cancelled by user" to the log, and revert the principal status to "Ready".
data
sessionread
transaction in that sessionNOTE: We won't validate the query just yet - but this will be needed in order to support other query types, such as Insert.
NOTE: In the future we might consider keeping the Session alive for some time - say up to a minute, and if a Session is open in the current tab when executing a query, reuse it, else reopen it.