Add query execution plan extensibility APIs (#4072)

* WIP 1

* WIP 2

* Fix typos

* Iterate on API a bit

* Query Tab WIP

* More dynamic query tab impl

* Fix merge breaks

* Update interfaces

* Update to single event handler for query events

* Remove query plan extension

* Add generated JS file
This commit is contained in:
Karl Burtram
2019-03-28 10:59:02 -07:00
committed by GitHub
parent ee413f3b24
commit cc2951265e
18 changed files with 688 additions and 12 deletions

View File

@@ -3576,6 +3576,31 @@ declare module 'azdata' {
* Namespace for interacting with query editor
*/
export namespace queryeditor {
export type QueryEvent =
| 'queryStart'
| 'queryStop'
| 'executionPlan';
export interface QueryEventListener {
onQueryEvent(type: QueryEvent, document: queryeditor.QueryDocument, args: any);
}
// new extensibility interfaces
export interface QueryDocument {
providerId: string;
uri: string;
// get the document's execution options
getOptions(): Map<string, string>;
// set the document's execution options
setOptions(options: Map<string, string>): void;
// tab content is build using the modelview UI builder APIs
// probably should rename DialogTab class since it is useful outside dialogs
createQueryTab(tab: window.DialogTab): void;
}
/**
* Make connection for the query editor
@@ -3588,7 +3613,14 @@ declare module 'azdata' {
* Run query if it is a query editor and it is already opened.
* @param {string} fileUri file URI for the query editor
*/
export function runQuery(fileUri: string): void;
export function runQuery(fileUri: string, options?: Map<string, string>): void;
/**
* Register a query event listener
*/
export function registerQueryEventListener(listener: queryeditor.QueryEventListener): void;
export function getQueryDocument(fileUri: string): queryeditor.QueryDocument
}
/**