mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Remove redundant usage of object URNs in database commands (#24485)
This commit is contained in:
@@ -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<string> {
|
||||
const params: contracts.DetachDatabaseRequestParams = { connectionUri, database, objectUrn, dropConnections, updateStatistics, generateScript };
|
||||
async detachDatabase(connectionUri: string, database: string, dropConnections: boolean, updateStatistics: boolean, generateScript: boolean): Promise<string> {
|
||||
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<string> {
|
||||
const params: contracts.DropDatabaseRequestParams = { connectionUri, database, objectUrn, dropConnections, deleteBackupHistory, generateScript };
|
||||
async dropDatabase(connectionUri: string, database: string, dropConnections: boolean, deleteBackupHistory: boolean, generateScript: boolean): Promise<string> {
|
||||
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<void> {
|
||||
const params: contracts.purgeQueryStoreDataRequestParams = { connectionUri, database, objectUrn };
|
||||
async purgeQueryStoreData(connectionUri: string, database: string): Promise<void> {
|
||||
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<string> {
|
||||
async detachDatabase(connectionUri: string, database: string, dropConnections: boolean, updateStatistics: boolean, generateScript: boolean): Promise<string> {
|
||||
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<string> {
|
||||
dropDatabase(connectionUri: string, database: string, dropConnections: boolean, deleteBackupHistory: boolean, generateScript: boolean): Thenable<string> {
|
||||
return this.delayAndResolve('');
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ export class TestObjectManagementService implements IObjectManagementService {
|
||||
return this.delayAndResolve([]);
|
||||
}
|
||||
|
||||
async purgeQueryStoreData(connectionUri: string, database: string, objectUrn: string): Promise<void> {
|
||||
async purgeQueryStoreData(connectionUri: string, database: string): Promise<void> {
|
||||
return this.delayAndResolve([]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1848,7 +1848,7 @@ export class DatabaseDialog extends ObjectManagementDialogBase<Database, Databas
|
||||
return;
|
||||
}
|
||||
|
||||
await this.objectManagementService.purgeQueryStoreData(this.options.connectionUri, this.options.database, this.options.objectUrn);
|
||||
await this.objectManagementService.purgeQueryStoreData(this.options.connectionUri, this.options.database);
|
||||
}
|
||||
|
||||
private async toggleQueryStoreOptions(): Promise<void> {
|
||||
|
||||
@@ -49,11 +49,11 @@ export class DetachDatabaseDialog extends ObjectManagementDialogBase<Database, D
|
||||
}
|
||||
|
||||
protected override async saveChanges(contextId: string, object: ObjectManagement.SqlObject): Promise<void> {
|
||||
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<string> {
|
||||
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<string[]> {
|
||||
|
||||
@@ -53,11 +53,11 @@ export class DropDatabaseDialog extends ObjectManagementDialogBase<Database, Dat
|
||||
}
|
||||
|
||||
protected override async saveChanges(contextId: string, object: ObjectManagement.SqlObject): Promise<void> {
|
||||
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<string> {
|
||||
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<string[]> {
|
||||
|
||||
Reference in New Issue
Block a user