From 037c49e2c687c89218dedbffd4712a38d52af087 Mon Sep 17 00:00:00 2001 From: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Date: Fri, 8 Mar 2019 19:01:21 -0800 Subject: [PATCH] Warning for table max rows displayed (#4357) * Warning for top rows * change single to double quotes when calling localize method --- .../workbench/services/notebook/sql/sqlSessionManager.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sql/workbench/services/notebook/sql/sqlSessionManager.ts b/src/sql/workbench/services/notebook/sql/sqlSessionManager.ts index 2b92760eb7..1bb1bce6cc 100644 --- a/src/sql/workbench/services/notebook/sql/sqlSessionManager.ts +++ b/src/sql/workbench/services/notebook/sql/sqlSessionManager.ts @@ -24,8 +24,8 @@ import { elapsedTimeLabel } from 'sql/parts/query/common/localizedConstants'; import * as notebookUtils from 'sql/parts/notebook/notebookUtils'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -export const sqlKernel: string = localize('sqlKernel', 'SQL'); -export const sqlKernelError: string = localize("sqlKernelError", "SQL kernel error"); +export const sqlKernel: string = localize('sqlKernel', "SQL"); +export const sqlKernelError: string = localize('sqlKernelError', "SQL kernel error"); export const MAX_ROWS = 5000; export const NotebookConfigSectionName = 'notebook'; export const MaxTableRowsConfigName = 'maxTableRows'; @@ -249,7 +249,7 @@ class SqlKernel extends Disposable implements nb.IKernel { this._future = new SQLFuture(this._queryRunner, count, this._configurationService); if (!canRun) { // Complete early - this._future.handleDone(new Error(localize('connectionRequired', 'A connection must be chosen to run notebook cells'))); + this._future.handleDone(new Error(localize('connectionRequired', "A connection must be chosen to run notebook cells"))); } // TODO should we cleanup old future? I don't think we need to @@ -406,6 +406,9 @@ export class SQLFuture extends Disposable implements FutureInternal { try { for (let resultSet of batch.resultSetSummaries) { let rowCount = resultSet.rowCount > this.configuredMaxRows ? this.configuredMaxRows : resultSet.rowCount; + if (rowCount === this.configuredMaxRows) { + this.handleMessage(localize('sqlMaxRowsDisplayed', "Displaying Top {0} rows.", rowCount)); + } await this.sendResultSetAsIOPub(rowCount, resultSet); } } catch (err) {