mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-23 17:23:02 -05:00
Update row count as updates are received (#6642)
This commit is contained in:
committed by
Karl Burtram
parent
f48b9e1b41
commit
b5fdf8c2a7
1
src/sql/azdata.d.ts
vendored
1
src/sql/azdata.d.ts
vendored
@@ -3994,6 +3994,7 @@ declare module 'azdata' {
|
||||
export namespace queryeditor {
|
||||
export type QueryEvent =
|
||||
| 'queryStart'
|
||||
| 'queryUpdate'
|
||||
| 'queryStop'
|
||||
| 'executionPlan'
|
||||
| 'visualize';
|
||||
|
||||
@@ -68,6 +68,7 @@ export interface IQueryModelService {
|
||||
showCommitError(error: string): void;
|
||||
|
||||
onRunQueryStart: Event<string>;
|
||||
onRunQueryUpdate: Event<string>;
|
||||
onRunQueryComplete: Event<string>;
|
||||
onQueryEvent: Event<IQueryEvent>;
|
||||
|
||||
|
||||
@@ -58,12 +58,14 @@ export class QueryModelService implements IQueryModelService {
|
||||
// MEMBER VARIABLES ////////////////////////////////////////////////////
|
||||
private _queryInfoMap: Map<string, QueryInfo>;
|
||||
private _onRunQueryStart: Emitter<string>;
|
||||
private _onRunQueryUpdate: Emitter<string>;
|
||||
private _onRunQueryComplete: Emitter<string>;
|
||||
private _onQueryEvent: Emitter<IQueryEvent>;
|
||||
private _onEditSessionReady: Emitter<azdata.EditSessionReadyParams>;
|
||||
|
||||
// EVENTS /////////////////////////////////////////////////////////////
|
||||
public get onRunQueryStart(): Event<string> { return this._onRunQueryStart.event; }
|
||||
public get onRunQueryUpdate(): Event<string> { return this._onRunQueryUpdate.event; }
|
||||
public get onRunQueryComplete(): Event<string> { return this._onRunQueryComplete.event; }
|
||||
public get onQueryEvent(): Event<IQueryEvent> { return this._onQueryEvent.event; }
|
||||
public get onEditSessionReady(): Event<azdata.EditSessionReadyParams> { return this._onEditSessionReady.event; }
|
||||
@@ -75,6 +77,7 @@ export class QueryModelService implements IQueryModelService {
|
||||
) {
|
||||
this._queryInfoMap = new Map<string, QueryInfo>();
|
||||
this._onRunQueryStart = new Emitter<string>();
|
||||
this._onRunQueryUpdate = new Emitter<string>();
|
||||
this._onRunQueryComplete = new Emitter<string>();
|
||||
this._onQueryEvent = new Emitter<IQueryEvent>();
|
||||
this._onEditSessionReady = new Emitter<azdata.EditSessionReadyParams>();
|
||||
@@ -299,6 +302,17 @@ export class QueryModelService implements IQueryModelService {
|
||||
|
||||
this._fireQueryEvent(uri, 'start');
|
||||
});
|
||||
queryRunner.onResultSetUpdate(() => {
|
||||
this._onRunQueryUpdate.fire(uri);
|
||||
|
||||
let event: IQueryEvent = {
|
||||
type: 'queryUpdate',
|
||||
uri: uri
|
||||
};
|
||||
this._onQueryEvent.fire(event);
|
||||
|
||||
this._fireQueryEvent(uri, 'update');
|
||||
});
|
||||
|
||||
queryRunner.onQueryPlanAvailable(planInfo => {
|
||||
// fire extensibility API event
|
||||
|
||||
@@ -158,6 +158,9 @@ export class RowCountStatusBarContributions extends Disposable implements IWorkb
|
||||
this.disposable.add(runner.onQueryStart(e => {
|
||||
this._displayValue(runner);
|
||||
}));
|
||||
this.disposable.add(runner.onResultSetUpdate(e => {
|
||||
this._displayValue(runner);
|
||||
}));
|
||||
this.disposable.add(runner.onQueryEnd(e => {
|
||||
this._displayValue(runner);
|
||||
}));
|
||||
@@ -167,6 +170,11 @@ export class RowCountStatusBarContributions extends Disposable implements IWorkb
|
||||
this._displayValue(this.queryModelService.getQueryRunner(uri));
|
||||
}
|
||||
}));
|
||||
this.disposable.add(this.queryModelService.onRunQueryUpdate(e => {
|
||||
if (e === uri) {
|
||||
this._displayValue(this.queryModelService.getQueryRunner(uri));
|
||||
}
|
||||
}));
|
||||
this.disposable.add(this.queryModelService.onRunQueryComplete(e => {
|
||||
if (e === uri) {
|
||||
this._displayValue(this.queryModelService.getQueryRunner(uri));
|
||||
|
||||
Reference in New Issue
Block a user