mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -05:00
remove unused metadata queries from backup (#538)
This commit is contained in:
@@ -143,7 +143,6 @@ namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery
|
|||||||
BackupConfigInfo configInfo = new BackupConfigInfo();
|
BackupConfigInfo configInfo = new BackupConfigInfo();
|
||||||
configInfo.RecoveryModel = GetRecoveryModel(databaseName);
|
configInfo.RecoveryModel = GetRecoveryModel(databaseName);
|
||||||
configInfo.DefaultBackupFolder = CommonUtilities.GetDefaultBackupFolder(this.serverConnection);
|
configInfo.DefaultBackupFolder = CommonUtilities.GetDefaultBackupFolder(this.serverConnection);
|
||||||
configInfo.LatestBackups = GetLatestBackupLocations(databaseName);
|
|
||||||
configInfo.BackupEncryptors = GetBackupEncryptors();
|
configInfo.BackupEncryptors = GetBackupEncryptors();
|
||||||
return configInfo;
|
return configInfo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,7 @@
|
|||||||
// Copyright (c) Microsoft. All rights reserved.
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
//
|
//
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Microsoft.SqlTools.ServiceLayer.Admin.Contracts;
|
|
||||||
|
|
||||||
namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery.Contracts
|
namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery.Contracts
|
||||||
{
|
{
|
||||||
@@ -13,21 +11,11 @@ namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery.Contracts
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class BackupConfigInfo
|
public class BackupConfigInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets default database info
|
|
||||||
/// </summary>
|
|
||||||
public DatabaseInfo DatabaseInfo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets recovery model of a database
|
/// Gets or sets recovery model of a database
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string RecoveryModel { get; set; }
|
public string RecoveryModel { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the latest backup set of a database
|
|
||||||
/// </summary>
|
|
||||||
public List<RestoreItemSource> LatestBackups { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the default backup folder
|
/// Gets or sets the default backup folder
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -153,7 +153,6 @@ namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery
|
|||||||
if (sqlConn != null && !connInfo.IsCloud)
|
if (sqlConn != null && !connInfo.IsCloud)
|
||||||
{
|
{
|
||||||
BackupConfigInfo backupConfigInfo = this.GetBackupConfigInfo(helper.DataContainer, sqlConn, sqlConn.Database);
|
BackupConfigInfo backupConfigInfo = this.GetBackupConfigInfo(helper.DataContainer, sqlConn, sqlConn.Database);
|
||||||
backupConfigInfo.DatabaseInfo = AdminService.GetDatabaseInfo(connInfo);
|
|
||||||
response.BackupConfigInfo = backupConfigInfo;
|
response.BackupConfigInfo = backupConfigInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,8 +62,7 @@ CREATE CERTIFICATE {1} WITH SUBJECT = 'Backup Encryption Certificate'; ";
|
|||||||
|
|
||||||
requestContext.Verify(x => x.SendResult(It.Is<BackupConfigInfoResponse>
|
requestContext.Verify(x => x.SendResult(It.Is<BackupConfigInfoResponse>
|
||||||
(p => p.BackupConfigInfo.RecoveryModel != string.Empty
|
(p => p.BackupConfigInfo.RecoveryModel != string.Empty
|
||||||
&& p.BackupConfigInfo.DefaultBackupFolder != string.Empty
|
&& p.BackupConfigInfo.DefaultBackupFolder != string.Empty)));
|
||||||
&& p.BackupConfigInfo.DatabaseInfo != null)));
|
|
||||||
|
|
||||||
testDb.Cleanup();
|
testDb.Cleanup();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user