mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Rename internal references to Delete Database to Drop Database (#24132)
This commit is contained in:
12
extensions/mssql/src/mssql.d.ts
vendored
12
extensions/mssql/src/mssql.d.ts
vendored
@@ -984,8 +984,16 @@ declare module 'mssql' {
|
|||||||
* @returns A string value representing the generated TSQL query if generateScript was set to true, and an empty string otherwise.
|
* @returns A string value representing the generated TSQL query if generateScript was set to true, and an empty string otherwise.
|
||||||
*/
|
*/
|
||||||
detachDatabase(connectionUri: string, objectUrn: string, dropConnections: boolean, updateStatistics: boolean, generateScript: boolean): Thenable<string>;
|
detachDatabase(connectionUri: string, objectUrn: string, dropConnections: boolean, updateStatistics: boolean, generateScript: boolean): Thenable<string>;
|
||||||
|
/**
|
||||||
deleteDatabase(connectionUri: string, objectUrn: string, dropConnections: boolean, deleteBackupHistory: boolean, generateScript: boolean): Thenable<string>;
|
* Drop a database.
|
||||||
|
* @param connectionUri The URI of the server connection.
|
||||||
|
* @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, objectUrn: string, dropConnections: boolean, deleteBackupHistory: boolean, generateScript: boolean): Thenable<string>;
|
||||||
}
|
}
|
||||||
// Object Management - End.
|
// Object Management - End.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export const ViewMemoryServerPropertiesDocUrl = 'https://learn.microsoft.com/sql
|
|||||||
export const DetachDatabaseDocUrl = 'https://go.microsoft.com/fwlink/?linkid=2240322';
|
export const DetachDatabaseDocUrl = 'https://go.microsoft.com/fwlink/?linkid=2240322';
|
||||||
export const DatabaseGeneralPropertiesDocUrl = 'https://learn.microsoft.com/sql/relational-databases/databases/database-properties-general-page';
|
export const DatabaseGeneralPropertiesDocUrl = 'https://learn.microsoft.com/sql/relational-databases/databases/database-properties-general-page';
|
||||||
export const DatabaseOptionsPropertiesDocUrl = 'https://learn.microsoft.com/sql/relational-databases/databases/database-properties-options-page'
|
export const DatabaseOptionsPropertiesDocUrl = 'https://learn.microsoft.com/sql/relational-databases/databases/database-properties-options-page'
|
||||||
export const DeleteDatabaseDocUrl = 'https://learn.microsoft.com/sql/t-sql/statements/drop-database-transact-sql';
|
export const DropDatabaseDocUrl = 'https://learn.microsoft.com/sql/t-sql/statements/drop-database-transact-sql';
|
||||||
|
|
||||||
export const enum TelemetryActions {
|
export const enum TelemetryActions {
|
||||||
CreateObject = 'CreateObject',
|
CreateObject = 'CreateObject',
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export class ObjectManagementService extends BaseService implements IObjectManag
|
|||||||
return this.runWithErrorHandling(contracts.DetachDatabaseRequest.type, params);
|
return this.runWithErrorHandling(contracts.DetachDatabaseRequest.type, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
async deleteDatabase(connectionUri: string, objectUrn: string, dropConnections: boolean, deleteBackupHistory: boolean, generateScript: boolean): Promise<string> {
|
async dropDatabase(connectionUri: string, objectUrn: string, dropConnections: boolean, deleteBackupHistory: boolean, generateScript: boolean): Promise<string> {
|
||||||
const params: contracts.DropDatabaseRequestParams = { connectionUri, objectUrn, dropConnections, deleteBackupHistory, generateScript };
|
const params: contracts.DropDatabaseRequestParams = { connectionUri, objectUrn, dropConnections, deleteBackupHistory, generateScript };
|
||||||
return this.runWithErrorHandling(contracts.DropDatabaseRequest.type, params);
|
return this.runWithErrorHandling(contracts.DropDatabaseRequest.type, params);
|
||||||
}
|
}
|
||||||
@@ -246,7 +246,7 @@ export class TestObjectManagementService implements IObjectManagementService {
|
|||||||
return this.delayAndResolve('');
|
return this.delayAndResolve('');
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteDatabase(connectionUri: string, objectUrn: string, dropConnections: boolean, deleteBackupHistory: boolean, generateScript: boolean): Thenable<string> {
|
dropDatabase(connectionUri: string, objectUrn: string, dropConnections: boolean, deleteBackupHistory: boolean, generateScript: boolean): Thenable<string> {
|
||||||
return this.delayAndResolve('');
|
return this.delayAndResolve('');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
import { ObjectManagementDialogBase, ObjectManagementDialogOptions } from './objectManagementDialogBase';
|
import { ObjectManagementDialogBase, ObjectManagementDialogOptions } from './objectManagementDialogBase';
|
||||||
import { IObjectManagementService, ObjectManagement } from 'mssql';
|
import { IObjectManagementService, ObjectManagement } from 'mssql';
|
||||||
import { Database, DatabaseViewInfo } from '../interfaces';
|
import { Database, DatabaseViewInfo } from '../interfaces';
|
||||||
import { DeleteDatabaseDocUrl } from '../constants';
|
import { DropDatabaseDocUrl } from '../constants';
|
||||||
import { DeleteButtonLabel, DeleteDatabaseDialogTitle, DeleteDropBackupHistory, DeleteDropConnections, DeleteDatabaseOptions, NameText, OwnerText, StatusText, DatabaseDetailsLabel } from '../localizedConstants';
|
import { DeleteButtonLabel, DeleteDatabaseDialogTitle, DeleteDropBackupHistory, DeleteDropConnections, DeleteDatabaseOptions, NameText, OwnerText, StatusText, DatabaseDetailsLabel } from '../localizedConstants';
|
||||||
|
|
||||||
export class DeleteDatabaseDialog extends ObjectManagementDialogBase<Database, DatabaseViewInfo> {
|
export class DeleteDatabaseDialog extends ObjectManagementDialogBase<Database, DatabaseViewInfo> {
|
||||||
@@ -45,15 +45,15 @@ export class DeleteDatabaseDialog extends ObjectManagementDialogBase<Database, D
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override get helpUrl(): string {
|
protected override get helpUrl(): string {
|
||||||
return DeleteDatabaseDocUrl;
|
return DropDatabaseDocUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async saveChanges(contextId: string, object: ObjectManagement.SqlObject): Promise<void> {
|
protected override async saveChanges(contextId: string, object: ObjectManagement.SqlObject): Promise<void> {
|
||||||
await this.objectManagementService.deleteDatabase(this.options.connectionUri, this.options.objectUrn, this._dropConnections, this._deleteBackupHistory, false);
|
await this.objectManagementService.dropDatabase(this.options.connectionUri, this.options.objectUrn, this._dropConnections, this._deleteBackupHistory, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async generateScript(): Promise<string> {
|
protected override async generateScript(): Promise<string> {
|
||||||
return await this.objectManagementService.deleteDatabase(this.options.connectionUri, this.options.objectUrn, this._dropConnections, this._deleteBackupHistory, true);
|
return await this.objectManagementService.dropDatabase(this.options.connectionUri, this.options.objectUrn, this._dropConnections, this._deleteBackupHistory, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async validateInput(): Promise<string[]> {
|
protected override async validateInput(): Promise<string[]> {
|
||||||
|
|||||||
Reference in New Issue
Block a user