mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-20 01:25:37 -05:00
* Initial commit * Fix up QueryEventType * Making query history visible in view and open query command (#6479) * Add QueryInfo to query event events * Pull actual query text/connection info for displaying * cons and expand (#6489) * Making query history visible in view and open query command * expand and icons * Failure icon enabled (#6491) * Making query history visible in view and open query command * expand and icons * failure icon enabled * Minor cleanup * Open query with connection and add run query (#6496) * Add initial query-history extension * Fix issues caused by master merge, cleanup and add query-history extension (#6567) * Open query with connection and add run query * Fix issues caused by latest master merges, cleanup and add query-history extension * Remove child nodes (#6568) * Open query with connection and add run query * Fix issues caused by latest master merges, cleanup and add query-history extension * Remove child node expansion * Layering movement and add delete action (#6574) * Open query with connection and add run query * Fix issues caused by latest master merges, cleanup and add query-history extension * Remove child node expansion * Some layering movement and add delete action * Move query tracking into service (#6578) * Open query with connection and add run query * Fix issues caused by latest master merges, cleanup and add query-history extension * Remove child node expansion * Some layering movement and add delete action * Move query history tracking into service * Add comment * Fix actions * Remove unnecessary type * cleanup * Remove unused section of README * Fix merge issues and address PR comments * Fix compile and tslint errors * Change startup function name
96 lines
3.7 KiB
TypeScript
96 lines
3.7 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import QueryRunner, { IQueryMessage } from 'sql/platform/query/common/queryRunner';
|
|
import { DataService } from 'sql/workbench/parts/grid/common/dataService';
|
|
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
|
import { Event } from 'vs/base/common/event';
|
|
import { QueryInput } from 'sql/workbench/parts/query/common/queryInput';
|
|
import {
|
|
ISelectionData,
|
|
ResultSetSubset,
|
|
EditUpdateCellResult,
|
|
EditSessionReadyParams,
|
|
EditSubsetResult,
|
|
EditCreateRowResult,
|
|
EditRevertCellResult,
|
|
ExecutionPlanOptions,
|
|
queryeditor
|
|
} from 'azdata';
|
|
import { QueryInfo } from 'sql/platform/query/common/queryModelService';
|
|
|
|
export const SERVICE_ID = 'queryModelService';
|
|
|
|
export const IQueryModelService = createDecorator<IQueryModelService>(SERVICE_ID);
|
|
|
|
export interface IQueryPlanInfo {
|
|
providerId: string;
|
|
fileUri: string;
|
|
planXml: string;
|
|
}
|
|
|
|
export interface IQueryInfo {
|
|
selection: ISelectionData[];
|
|
messages: IQueryMessage[];
|
|
}
|
|
|
|
export interface IQueryEvent {
|
|
type: queryeditor.QueryEventType;
|
|
uri: string;
|
|
queryInfo: IQueryInfo;
|
|
params?: any;
|
|
}
|
|
|
|
/**
|
|
* Interface for the logic of handling running queries and grid interactions for all URIs.
|
|
*/
|
|
export interface IQueryModelService {
|
|
_serviceBrand: any;
|
|
|
|
getQueryRunner(uri: string): QueryRunner;
|
|
|
|
getConfig(): Promise<{ [key: string]: any }>;
|
|
getShortcuts(): Promise<any>;
|
|
getQueryRows(uri: string, rowStart: number, numberOfRows: number, batchId: number, resultId: number): Thenable<ResultSetSubset>;
|
|
runQuery(uri: string, selection: ISelectionData, queryInput: QueryInput, runOptions?: ExecutionPlanOptions): void;
|
|
runQueryStatement(uri: string, selection: ISelectionData, queryInput: QueryInput): void;
|
|
runQueryString(uri: string, selection: string, queryInput: QueryInput);
|
|
cancelQuery(input: QueryRunner | string): void;
|
|
disposeQuery(uri: string): void;
|
|
isRunningQuery(uri: string): boolean;
|
|
|
|
getDataService(uri: string): DataService;
|
|
refreshResultsets(uri: string): void;
|
|
sendGridContentEvent(uri: string, eventName: string): void;
|
|
resizeResultsets(uri: string): void;
|
|
onAngularLoaded(uri: string): void;
|
|
|
|
copyResults(uri: string, selection: Slick.Range[], batchId: number, resultId: number, includeHeaders?: boolean): void;
|
|
setEditorSelection(uri: string, index: number): void;
|
|
showWarning(uri: string, message: string): void;
|
|
showError(uri: string, message: string): void;
|
|
showCommitError(error: string): void;
|
|
|
|
onRunQueryStart: Event<string>;
|
|
onRunQueryUpdate: Event<string>;
|
|
onRunQueryComplete: Event<string>;
|
|
onQueryEvent: Event<IQueryEvent>;
|
|
|
|
// Edit Data Functions
|
|
initializeEdit(ownerUri: string, schemaName: string, objectName: string, objectType: string, rowLimit: number, queryString: string): void;
|
|
disposeEdit(ownerUri: string): Thenable<void>;
|
|
updateCell(ownerUri: string, rowId: number, columnId: number, newValue: string): Thenable<EditUpdateCellResult>;
|
|
commitEdit(ownerUri): Thenable<void>;
|
|
createRow(ownerUri: string): Thenable<EditCreateRowResult>;
|
|
deleteRow(ownerUri: string, rowId: number): Thenable<void>;
|
|
revertCell(ownerUri: string, rowId: number, columnId: number): Thenable<EditRevertCellResult>;
|
|
revertRow(ownerUri: string, rowId: number): Thenable<void>;
|
|
getEditRows(ownerUri: string, rowStart: number, numberOfRows: number): Thenable<EditSubsetResult>;
|
|
|
|
_getQueryInfo(uri: string): QueryInfo;
|
|
// Edit Data Callbacks
|
|
onEditSessionReady: Event<EditSessionReadyParams>;
|
|
}
|