Query Management log message update (#23395)

This commit is contained in:
Alan Ren
2023-06-15 21:01:15 -07:00
committed by GitHub
parent ebf9c251a9
commit 7a7a38dd24
14 changed files with 67 additions and 129 deletions

View File

@@ -124,7 +124,7 @@ export class QueryManagementService implements IQueryManagementService {
constructor(
@IConnectionManagementService private _connectionService: IConnectionManagementService,
@IAdsTelemetryService private _telemetryService: IAdsTelemetryService,
@ILogService private _logService: ILogService,
@ILogService private _logService: ILogService
) {
}
@@ -278,9 +278,10 @@ export class QueryManagementService implements IQueryManagementService {
const result = [];
let start = rowData.rowsStartIndex;
this._logService.trace(`Getting ${rowData.rowsCount} rows starting from index: ${rowData.rowsStartIndex}.`);
let pageIdx = 1;
do {
const rowCount = Math.min(pageSize, rowData.rowsStartIndex + rowData.rowsCount - start);
this._logService.trace(`Paged Fetch - Getting ${rowCount} rows starting from index: ${start}.`);
this._logService.trace(`Page ${pageIdx} - Getting ${rowCount} rows starting from index: ${start}.`);
const rowSet = await runner.getQueryRows({
ownerUri: rowData.ownerUri,
batchIndex: rowData.batchIndex,
@@ -288,9 +289,10 @@ export class QueryManagementService implements IQueryManagementService {
rowsCount: rowCount,
rowsStartIndex: start
});
this._logService.trace(`Paged Fetch - Received ${rowSet.resultSubset.rows} rows starting from index: ${start}.`);
this._logService.trace(`Page ${pageIdx} - Received ${rowSet.resultSubset.rows.length} rows starting from index: ${start}.`);
result.push(...rowSet.resultSubset.rows);
start += rowCount;
pageIdx++;
if (onProgressCallback) {
onProgressCallback(start - rowData.rowsStartIndex);
}

View File

@@ -60,8 +60,8 @@ export class QueryEditorService implements IQueryEditorService {
const mode = this._connectionManagementService.getProviderLanguageMode(connectionProviderName);
const fileInput = await this._editorService.createEditorInput({ forceUntitled: true, resource: docUri, languageId: mode }) as UntitledTextEditorInput;
let untitledEditorModel = await fileInput.resolve();
if (options.initalContent) {
untitledEditorModel.textEditorModel.setValue(options.initalContent);
if (options.initialContent) {
untitledEditorModel.textEditorModel.setValue(options.initialContent);
if (options.dirty === false || (options.dirty === undefined && !this._configurationService.getValue<IQueryEditorConfiguration>('queryEditor').promptToSaveGeneratedFiles)) {
(untitledEditorModel as UntitledTextEditorModel).setDirty(false);
}

View File

@@ -19,7 +19,7 @@ export interface IQueryEditorOptions extends IEditorOptions {
export const IQueryEditorService = createDecorator<IQueryEditorService>('QueryEditorService');
export interface INewSqlEditorOptions {
initalContent?: string;
initialContent?: string;
/**
* Defaults based on user configuration
*/

View File

@@ -119,7 +119,7 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
try {
this.updateState(this.valid, this.dirty, 'generateScript');
const script = await this._provider.generateScript(this.tableInfo);
this._queryEditorService.newSqlEditor({ initalContent: script });
this._queryEditorService.newSqlEditor({ initialContent: script });
this.updateState(this.valid, this.dirty);
notificationHandle.updateMessage(localize('tableDesigner.generatingScriptCompleted', "Script generated."));
generateScriptEvent.withAdditionalMeasurements({

View File

@@ -213,7 +213,7 @@ export class TaskService implements ITaskService {
if ((task.status === TaskStatus.Succeeded || task.status === TaskStatus.SucceededWithWarning)
&& eventArgs.script && eventArgs.script !== '') {
if (task.taskExecutionMode === TaskExecutionMode.script) {
this.queryEditorService.newSqlEditor({ initalContent: eventArgs.script });
this.queryEditorService.newSqlEditor({ initialContent: eventArgs.script });
} else if (task.taskExecutionMode === TaskExecutionMode.executeAndScript) {
task.script = eventArgs.script;
}