diff --git a/extensions/mssql/config.json b/extensions/mssql/config.json index 7d67a93b82..dfab333ca1 100644 --- a/extensions/mssql/config.json +++ b/extensions/mssql/config.json @@ -1,6 +1,6 @@ { "downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}", - "version": "4.10.0.2", + "version": "4.10.0.4", "downloadFileNames": { "Windows_86": "win-x86-net7.0.zip", "Windows_64": "win-x64-net7.0.zip", diff --git a/extensions/mssql/src/contracts.ts b/extensions/mssql/src/contracts.ts index c51c655426..e4b5e91fe0 100644 --- a/extensions/mssql/src/contracts.ts +++ b/extensions/mssql/src/contracts.ts @@ -1649,7 +1649,6 @@ export namespace SearchObjectRequest { export interface DetachDatabaseRequestParams { connectionUri: string; database: string; - objectUrn: string; dropConnections: boolean; updateStatistics: boolean; generateScript: boolean; @@ -1662,7 +1661,6 @@ export namespace DetachDatabaseRequest { export interface DropDatabaseRequestParams { connectionUri: string; database: string; - objectUrn: string; dropConnections: boolean; deleteBackupHistory: boolean; generateScript: boolean; @@ -1700,13 +1698,12 @@ export namespace GetAssociatedFilesRequest { } export namespace PurgeQueryStoreDataRequest { - export const type = new RequestType('objectManagement/purgeQueryStoreData'); + export const type = new RequestType('objectManagement/purgeQueryStoreData'); } -export interface purgeQueryStoreDataRequestParams { +export interface PurgeQueryStoreDataRequestParams { connectionUri: string; database: string; - objectUrn: string; } // ------------------------------- < Object Management > ------------------------------------ diff --git a/extensions/mssql/src/mssql.d.ts b/extensions/mssql/src/mssql.d.ts index 2a439c894e..a15b7a8a16 100644 --- a/extensions/mssql/src/mssql.d.ts +++ b/extensions/mssql/src/mssql.d.ts @@ -981,13 +981,12 @@ declare module 'mssql' { * Detach a 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 * @param dropConnections Whether to drop active connections to this database. * @param updateStatistics Whether to update the optimization statistics related to this database. * @param generateScript Whether to generate a TSQL script for the operation instead of detaching the database. * @returns A string value representing the generated TSQL query if generateScript was set to true, and an empty string otherwise. */ - detachDatabase(connectionUri: string, database: string, objectUrn: string, dropConnections: boolean, updateStatistics: boolean, generateScript: boolean): Thenable; + detachDatabase(connectionUri: string, database: string, dropConnections: boolean, updateStatistics: boolean, generateScript: boolean): Thenable; /** * Attach one or more databases. * @param connectionUri The URI of the server connection. @@ -1000,13 +999,12 @@ declare module 'mssql' { * Drop a 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 * @param dropConnections Whether to drop active connections to this database. * @param deleteBackupHistory Whether to delete backup and restore history information for this database. * @param generateScript Whether to generate a TSQL script for the operation instead of detaching the database. * @returns A string value representing the generated TSQL query if generateScript was set to true, and an empty string otherwise. */ - dropDatabase(connectionUri: string, database: string, objectUrn: string, dropConnections: boolean, deleteBackupHistory: boolean, generateScript: boolean): Thenable; + dropDatabase(connectionUri: string, database: string, dropConnections: boolean, deleteBackupHistory: boolean, generateScript: boolean): Thenable; /** * Gets the file path for the default database file folder for a SQL Server instance. * @param connectionUri The URI of the connection for the specific server. @@ -1024,9 +1022,8 @@ declare module 'mssql' { * 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; + purgeQueryStoreData(connectionUri: string, database: string): Thenable; } export interface DatabaseFileData { diff --git a/extensions/mssql/src/objectManagement/objectManagementService.ts b/extensions/mssql/src/objectManagement/objectManagementService.ts index 3b37aeb0d6..f4c8f0b208 100644 --- a/extensions/mssql/src/objectManagement/objectManagementService.ts +++ b/extensions/mssql/src/objectManagement/objectManagementService.ts @@ -66,13 +66,13 @@ export class ObjectManagementService extends BaseService implements IObjectManag return this.runWithErrorHandling(contracts.SearchObjectRequest.type, params); } - async detachDatabase(connectionUri: string, database: string, objectUrn: string, dropConnections: boolean, updateStatistics: boolean, generateScript: boolean): Promise { - const params: contracts.DetachDatabaseRequestParams = { connectionUri, database, objectUrn, dropConnections, updateStatistics, generateScript }; + async detachDatabase(connectionUri: string, database: string, dropConnections: boolean, updateStatistics: boolean, generateScript: boolean): Promise { + const params: contracts.DetachDatabaseRequestParams = { connectionUri, database, dropConnections, updateStatistics, generateScript }; return this.runWithErrorHandling(contracts.DetachDatabaseRequest.type, params); } - async dropDatabase(connectionUri: string, database: string, objectUrn: string, dropConnections: boolean, deleteBackupHistory: boolean, generateScript: boolean): Promise { - const params: contracts.DropDatabaseRequestParams = { connectionUri, database, objectUrn, dropConnections, deleteBackupHistory, generateScript }; + async dropDatabase(connectionUri: string, database: string, dropConnections: boolean, deleteBackupHistory: boolean, generateScript: boolean): Promise { + const params: contracts.DropDatabaseRequestParams = { connectionUri, database, dropConnections, deleteBackupHistory, generateScript }; return this.runWithErrorHandling(contracts.DropDatabaseRequest.type, params); } @@ -91,8 +91,8 @@ export class ObjectManagementService extends BaseService implements IObjectManag return this.runWithErrorHandling(contracts.GetAssociatedFilesRequest.type, params); } - async purgeQueryStoreData(connectionUri: string, database: string, objectUrn: string): Promise { - const params: contracts.purgeQueryStoreDataRequestParams = { connectionUri, database, objectUrn }; + async purgeQueryStoreData(connectionUri: string, database: string): Promise { + const params: contracts.PurgeQueryStoreDataRequestParams = { connectionUri, database }; return this.runWithErrorHandling(contracts.PurgeQueryStoreDataRequest.type, params); } } @@ -262,7 +262,7 @@ export class TestObjectManagementService implements IObjectManagementService { return this.delayAndResolve(items); } - async detachDatabase(connectionUri: string, database: string, objectUrn: string, dropConnections: boolean, updateStatistics: boolean, generateScript: boolean): Promise { + async detachDatabase(connectionUri: string, database: string, dropConnections: boolean, updateStatistics: boolean, generateScript: boolean): Promise { return this.delayAndResolve(''); } @@ -270,7 +270,7 @@ export class TestObjectManagementService implements IObjectManagementService { return this.delayAndResolve(''); } - dropDatabase(connectionUri: string, database: string, objectUrn: string, dropConnections: boolean, deleteBackupHistory: boolean, generateScript: boolean): Thenable { + dropDatabase(connectionUri: string, database: string, dropConnections: boolean, deleteBackupHistory: boolean, generateScript: boolean): Thenable { return this.delayAndResolve(''); } @@ -282,7 +282,7 @@ export class TestObjectManagementService implements IObjectManagementService { return this.delayAndResolve([]); } - async purgeQueryStoreData(connectionUri: string, database: string, objectUrn: string): Promise { + async purgeQueryStoreData(connectionUri: string, database: string): Promise { return this.delayAndResolve([]); } diff --git a/extensions/mssql/src/objectManagement/ui/databaseDialog.ts b/extensions/mssql/src/objectManagement/ui/databaseDialog.ts index a4619f3b10..0a7b90b9e1 100644 --- a/extensions/mssql/src/objectManagement/ui/databaseDialog.ts +++ b/extensions/mssql/src/objectManagement/ui/databaseDialog.ts @@ -1848,7 +1848,7 @@ export class DatabaseDialog extends ObjectManagementDialogBase { diff --git a/extensions/mssql/src/objectManagement/ui/detachDatabaseDialog.ts b/extensions/mssql/src/objectManagement/ui/detachDatabaseDialog.ts index 143011e20b..eff28f399d 100644 --- a/extensions/mssql/src/objectManagement/ui/detachDatabaseDialog.ts +++ b/extensions/mssql/src/objectManagement/ui/detachDatabaseDialog.ts @@ -49,11 +49,11 @@ export class DetachDatabaseDialog extends ObjectManagementDialogBase { - await this.objectManagementService.detachDatabase(this.options.connectionUri, this.options.database, this.options.objectUrn, this._dropConnections, this._updateStatistics, false); + await this.objectManagementService.detachDatabase(this.options.connectionUri, this.options.database, this._dropConnections, this._updateStatistics, false); } protected override async generateScript(): Promise { - return await this.objectManagementService.detachDatabase(this.options.connectionUri, this.options.database, this.options.objectUrn, this._dropConnections, this._updateStatistics, true); + return await this.objectManagementService.detachDatabase(this.options.connectionUri, this.options.database, this._dropConnections, this._updateStatistics, true); } protected override async validateInput(): Promise { diff --git a/extensions/mssql/src/objectManagement/ui/dropDatabaseDialog.ts b/extensions/mssql/src/objectManagement/ui/dropDatabaseDialog.ts index 8b6c845aaf..fe76c26d0e 100644 --- a/extensions/mssql/src/objectManagement/ui/dropDatabaseDialog.ts +++ b/extensions/mssql/src/objectManagement/ui/dropDatabaseDialog.ts @@ -53,11 +53,11 @@ export class DropDatabaseDialog extends ObjectManagementDialogBase { - await this.objectManagementService.dropDatabase(this.options.connectionUri, this.options.database, this.options.objectUrn, this._dropConnections, this._deleteBackupHistory, false); + await this.objectManagementService.dropDatabase(this.options.connectionUri, this.options.database, this._dropConnections, this._deleteBackupHistory, false); } protected override async generateScript(): Promise { - return await this.objectManagementService.dropDatabase(this.options.connectionUri, this.options.database, this.options.objectUrn, this._dropConnections, this._deleteBackupHistory, true); + return await this.objectManagementService.dropDatabase(this.options.connectionUri, this.options.database, this._dropConnections, this._deleteBackupHistory, true); } protected override async validateInput(): Promise {