Skip to content

Commit

Permalink
Merge branch 'main' into corivera/remoteFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
corivera committed Sep 11, 2023
2 parents 0541adf + 89e4157 commit 75b11bb
Show file tree
Hide file tree
Showing 94 changed files with 5,763 additions and 844 deletions.
2 changes: 1 addition & 1 deletion extensions/azuremonitor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
"update-grammar": "node ../../build/npm/update-grammar.js Microsoft/vscode-azuremonitor ./syntaxes/azuremonitor.tmLanguage"
},
"dependencies": {
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#1.3.6",
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#1.3.7",
"figures": "^2.0.0",
"find-remove": "1.2.1",
"@microsoft/ads-service-downloader": "^1.2.1",
Expand Down
6 changes: 3 additions & 3 deletions extensions/azuremonitor/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ [email protected]:
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=

"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#1.3.6":
version "1.3.6"
resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/fdd415fd7c79c5c889f192a9122ba41dca66b35b"
"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#1.3.7":
version "1.3.7"
resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/0f07d03394eeebc2924971746470ac8224348fa4"
dependencies:
vscode-languageclient "5.2.1"

Expand Down
2 changes: 1 addition & 1 deletion extensions/datavirtualization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"dependencies": {
"@microsoft/ads-extension-telemetry": "^3.0.1",
"@microsoft/ads-service-downloader": "^1.2.1",
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#1.3.6",
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#1.3.7",
"vscode-nls": "^5.2.0"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions extensions/datavirtualization/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,9 @@ [email protected]:
resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b"
integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==

"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#1.3.6":
version "1.3.6"
resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/fdd415fd7c79c5c889f192a9122ba41dca66b35b"
"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#1.3.7":
version "1.3.7"
resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/0f07d03394eeebc2924971746470ac8224348fa4"
dependencies:
vscode-languageclient "5.2.1"

Expand Down
2 changes: 1 addition & 1 deletion extensions/import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
}
},
"dependencies": {
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#1.3.6",
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#1.3.7",
"htmlparser2": "^3.10.1",
"@microsoft/ads-service-downloader": "^1.2.1",
"@microsoft/ads-extension-telemetry": "^3.0.1",
Expand Down
2 changes: 1 addition & 1 deletion extensions/import/src/test/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class TestQueryProvider implements azdata.QueryProvider {
saveResults(requestParams: azdata.SaveResultsRequestParams): Thenable<azdata.SaveResultRequestResult> {
throw new Error('Method not implemented.');
}
copyResults(requestParams: azdata.CopyResultsRequestParams): Thenable<void> {
copyResults(requestParams: azdata.CopyResultsRequestParams): Thenable<azdata.CopyResultsRequestResult> {
throw new Error('Method not implemented.');
}
setQueryExecutionOptions(ownerUri: string, options: azdata.QueryExecutionOptions): Thenable<void> {
Expand Down
6 changes: 3 additions & 3 deletions extensions/import/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -572,9 +572,9 @@ crypt@~0.0.1:
resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b"
integrity sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=

"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#1.3.6":
version "1.3.6"
resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/fdd415fd7c79c5c889f192a9122ba41dca66b35b"
"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#1.3.7":
version "1.3.7"
resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/0f07d03394eeebc2924971746470ac8224348fa4"
dependencies:
vscode-languageclient "5.2.1"

Expand Down
2 changes: 1 addition & 1 deletion extensions/kusto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@
}
},
"dependencies": {
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#1.3.6",
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#1.3.7",
"figures": "^2.0.0",
"find-remove": "1.2.1",
"@microsoft/ads-service-downloader": "^1.2.1",
Expand Down
6 changes: 3 additions & 3 deletions extensions/kusto/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ [email protected]:
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=

"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#1.3.6":
version "1.3.6"
resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/fdd415fd7c79c5c889f192a9122ba41dca66b35b"
"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#1.3.7":
version "1.3.7"
resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/0f07d03394eeebc2924971746470ac8224348fa4"
dependencies:
vscode-languageclient "5.2.1"

Expand Down
2 changes: 1 addition & 1 deletion extensions/mssql/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
"version": "4.9.0.32",
"version": "4.9.0.37",
"downloadFileNames": {
"Windows_86": "win-x86-net7.0.zip",
"Windows_64": "win-x64-net7.0.zip",
Expand Down
15 changes: 5 additions & 10 deletions extensions/mssql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
}
],
"commands": [
{
"command": "objectExplorer.scriptAsAlter",
"title": "Script as Alter"
},
{
"command": "mssql.exportSqlAsNotebook",
"title": "%mssql.exportSqlAsNotebook%"
Expand Down Expand Up @@ -157,6 +153,10 @@
"dark": "resources/dark/groupBySchemaDisabled_inverse.svg",
"light": "resources/light/groupBySchemaDisabled.svg"
}
},
{
"command": "mssql.clearPooledConnections",
"title": "%mssql.connection.clearPooledConnections%"
}
],
"outputChannels": [
Expand Down Expand Up @@ -537,11 +537,6 @@
}
],
"objectExplorer/item/context": [
{
"command": "objectExplorer.scriptAsAlter",
"when": "nodeType == Table",
"group": "0_query@5"
},
{
"command": "mssql.designTable",
"when": "connectionProvider == MSSQL && nodeType == Table && nodeSubType != LedgerDropped",
Expand Down Expand Up @@ -1572,7 +1567,7 @@
"dependencies": {
"@microsoft/ads-extension-telemetry": "^3.0.1",
"@microsoft/ads-service-downloader": "^1.2.1",
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#1.3.6",
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#1.3.7",
"find-remove": "1.2.1",
"vscode-languageclient": "5.2.1",
"vscode-nls": "^4.0.0"
Expand Down
5 changes: 3 additions & 2 deletions extensions/mssql/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"mssql.connectionOptions.connectionName.description": "Custom name of the connection",
"mssql.connectionOptions.serverName.displayName": "Server",
"mssql.connectionOptions.serverName.description": "Name of the SQL Server instance",
"mssql.connectionOptions.serverName.placeholder": "e.g. tcp:servername,1433",
"mssql.connectionOptions.serverName.placeholder": "e.g. servername,port",
"mssql.connectionOptions.databaseName.displayName": "Database",
"mssql.connectionOptions.databaseName.description": "The name of the initial catalog or database int the data source",
"mssql.connectionOptions.authType.displayName": "Authentication type",
Expand Down Expand Up @@ -174,9 +174,10 @@
"title.newTable": "New Table",
"title.designTable": "Design",
"title.changeNotebookConnection": "Change SQL Notebook Connection",
"mssql.connection.clearPooledConnections": "SQL Server: Clear Pooled Connections",
"mssql.parallelMessageProcessing": "[Experimental] Whether the requests to the SQL Tools Service should be handled in parallel. This is introduced to discover the issues there might be when handling all requests in parallel. The default value is false. Azure Data Studio is required to be relaunched when the value is changed.",
"mssql.enableSqlAuthenticationProvider": "Enables use of the Sql Authentication Provider for 'Active Directory Interactive' authentication mode when user selects 'AzureMFA' authentication. This enables Server-side resource endpoint integration when fetching access tokens. This option is only supported for 'MSAL' Azure Authentication Library. Azure Data Studio is required to be relaunched when the value is changed.",
"mssql.enableConnectionPooling": "Enables connection pooling on MSSQL connections to improve overall performance of Azure Data Studio connectivity. This setting is enabled by default. Azure Data Studio is required to be relaunched when the value is changed.",
"mssql.enableConnectionPooling": "Enables connection pooling on MSSQL connections to improve overall performance of Azure Data Studio connectivity. This setting is enabled by default. Azure Data Studio is required to be relaunched when the value is changed. To clear pooled connections, run the command: 'SQL Server: Clear Pooled Connections'",
"mssql.tableDesigner.preloadDatabaseModel": "Whether to preload the database model when the database node in the object explorer is expanded. When enabled, the loading time of table designer can be reduced. Note: You might see higher than normal memory usage if you need to expand a lot of database nodes.",
"mssql.tableDesigner.allowDisableAndReenableDdlTriggers": "Whether to allow table designer to disable and re-enable DDL triggers during publish",
"mssql.objectExplorer.groupBySchema": "When enabled, the database objects in Object Explorer will be categorized by schema.",
Expand Down
19 changes: 19 additions & 0 deletions extensions/mssql/src/connection/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { AppContext } from '../appContext';
import * as vscode from 'vscode';
import * as constants from './constants';
import { ConnectionService } from './connectionService';

export function registerConnectionCommands(appContext: AppContext) {
appContext.extensionContext.subscriptions.push(vscode.commands.registerCommand('mssql.clearPooledConnections', async () => {
await getConnectionService(appContext).clearPooledConnections();
}));
}

function getConnectionService(appContext: AppContext): ConnectionService {
return appContext.getService<ConnectionService>(constants.ConnectionService);
}
33 changes: 33 additions & 0 deletions extensions/mssql/src/connection/connectionService.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import * as constants from './constants';
import * as contracts from '../contracts';

import { BaseService, ISqlOpsFeature, SqlOpsDataClient } from 'dataprotocol-client';
import { ClientCapabilities } from 'vscode-languageclient';
import { AppContext } from '../appContext';

export class ConnectionService extends BaseService {
public static asFeature(context: AppContext): ISqlOpsFeature {
return class extends ConnectionService {
constructor(client: SqlOpsDataClient) {
super(context, client);
}

fillClientCapabilities(_: ClientCapabilities): void { }
initialize(): void { }
};
}

private constructor(context: AppContext, client: SqlOpsDataClient) {
super(client);
context.registerService(constants.ConnectionService, this);
}

async clearPooledConnections(): Promise<void> {
return this.runWithErrorHandling(contracts.ClearPooledConnectionsRequest.type, {});
}
}
6 changes: 6 additions & 0 deletions extensions/mssql/src/connection/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

export const ConnectionService = 'ConnectionService';
15 changes: 15 additions & 0 deletions extensions/mssql/src/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,16 @@ export namespace GetAssociatedFilesRequest {
export const type = new RequestType<GetAssociatedFilesRequestParams, string[], void, void>('admin/getassociatedfiles');
}

export namespace PurgeQueryStoreDataRequest {
export const type = new RequestType<purgeQueryStoreDataRequestParams, void, void, void>('objectManagement/purgeQueryStoreData');
}

export interface purgeQueryStoreDataRequestParams {
connectionUri: string;
database: string;
objectUrn: string;
}

// ------------------------------- < Object Management > ------------------------------------

// ------------------------------- < Encryption IV/KEY updation Event > ------------------------------------
Expand All @@ -1723,6 +1733,11 @@ export namespace EncryptionKeysChangedNotification {
export const type = new NotificationType<DidChangeEncryptionIVKeyParams, void>('connection/encryptionKeysChanged');
}

// ------------------------------- < Clear Pooled Connections Request > ---------------------------------------

export namespace ClearPooledConnectionsRequest {
export const type = new RequestType<object, void, void, void>('connection/clearpooledconnections');
}
// ------------------------------- < Query Store > ------------------------------------
//#region Query Store

Expand Down
2 changes: 2 additions & 0 deletions extensions/mssql/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { registerTableDesignerCommands } from './tableDesigner/tableDesigner';
import { registerObjectManagementCommands } from './objectManagement/commands';
import { TelemetryActions, TelemetryReporter, TelemetryViews } from './telemetry';
import { noConvertResult, noDocumentFound, unsupportedPlatform } from './localizedConstants';
import { registerConnectionCommands } from './connection/commands';

const localize = nls.loadMessageBundle();

Expand Down Expand Up @@ -156,6 +157,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<IExten

registerTableDesignerCommands(appContext);
registerObjectManagementCommands(appContext);
registerConnectionCommands(appContext);

// context.subscriptions.push(new SqlNotebookController()); Temporarily disabled due to breaking query editor

Expand Down
7 changes: 7 additions & 0 deletions extensions/mssql/src/mssql.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,13 @@ declare module 'mssql' {
* @returns An array of file path strings for each of the associated files.
*/
getAssociatedFiles(connectionUri: string, primaryFilePath: string): Thenable<string[]>;
/**
* Clears all query store data from the database
* @param connectionUri The URI of the server connection.
* @param database The target database.
* @param objectUrn SMO Urn of the database to be detached. More information: https://learn.microsoft.com/sql/relational-databases/server-management-objects-smo/overview-smo
*/
purgeQueryStoreData(connectionUri: string, database: string, objectUrn: string): Thenable<void>;
}

export interface DatabaseFileData {
Expand Down
1 change: 1 addition & 0 deletions extensions/mssql/src/objectManagement/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const DatabaseGeneralPropertiesDocUrl = 'https://learn.microsoft.com/sql/
export const DatabaseOptionsPropertiesDocUrl = 'https://learn.microsoft.com/sql/relational-databases/databases/database-properties-options-page'
export const DropDatabaseDocUrl = 'https://learn.microsoft.com/sql/t-sql/statements/drop-database-transact-sql';
export const DatabaseScopedConfigurationPropertiesDocUrl = 'https://learn.microsoft.com/sql/t-sql/statements/alter-database-scoped-configuration-transact-sql'
export const QueryStorePropertiesDocUrl = 'https://learn.microsoft.com/sql/relational-databases/databases/database-properties-query-store-page'
export const DatabaseFilesPropertiesDocUrl = 'https://learn.microsoft.com/sql/relational-databases/databases/database-properties-files-page'
export const DatabaseFileGroupsPropertiesDocUrl = 'https://learn.microsoft.com/sql/relational-databases/databases/database-properties-filegroups-page'

Expand Down
27 changes: 27 additions & 0 deletions extensions/mssql/src/objectManagement/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ export interface Database extends ObjectManagement.SqlObject {
isFilesTabSupported?: boolean;
files?: DatabaseFile[];
filegroups?: FileGroup[];
queryStoreOptions?: QueryStoreOptions;
}

export interface DatabaseViewInfo extends ObjectManagement.ObjectViewInfo<Database> {
Expand All @@ -481,6 +482,32 @@ export interface DatabaseViewInfo extends ObjectManagement.ObjectViewInfo<Databa
rowDataFileGroupsOptions?: string[];
fileStreamFileGroupsOptions?: string[];
fileTypesOptions?: string[];
operationModeOptions?: string[];
statisticsCollectionIntervalOptions?: string[];
queryStoreCaptureModeOptions?: string[];
sizeBasedCleanupModeOptions?: string[];
staleThresholdOptions?: string[];
}

export interface QueryStoreOptions {
actualMode: string;
dataFlushIntervalInMinutes: number;
statisticsCollectionInterval: string;
maxPlansPerQuery: number;
maxSizeInMB: number;
queryStoreCaptureMode: string;
sizeBasedCleanupMode: string;
staleQueryThresholdInDays: number;
waitStatisticsCaptureMode?: boolean;
capturePolicyOptions?: QueryStoreCapturePolicyOptions;
currentStorageSizeInMB: number;
}

export interface QueryStoreCapturePolicyOptions {
executionCount: number;
staleThreshold: string;
totalCompileCPUTimeInMS: number;
totalExecutionCPUTimeInMS: number;
}

export interface DatabaseScopedConfigurationsInfo {
Expand Down
Loading

0 comments on commit 75b11bb

Please sign in to comment.