Enable Detach Database in database handler (#2110)

This commit is contained in:
Cory Rivera
2023-06-22 17:28:41 -07:00
committed by GitHub
parent 2052b597c9
commit 9d0d4b0cae
5 changed files with 332 additions and 32 deletions

View File

@@ -0,0 +1,40 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
#nullable disable
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
using Microsoft.SqlTools.Utility;
namespace Microsoft.SqlTools.ServiceLayer.ObjectManagement.Contracts
{
public class DetachDatabaseRequestParams : GeneralRequestDetails
{
/// <summary>
/// SFC (SMO) URN identifying the object
/// </summary>
public string ObjectUrn { get; set; }
/// <summary>
/// URI of the underlying connection for this request
/// </summary>
public string ConnectionUri { get; set; }
/// <summary>
/// Whether to drop active connections to this database
/// </summary>
public bool DropConnections { get; set; }
/// <summary>
/// Whether to update the optimization statistics related to this database
/// </summary>
public bool UpdateStatistics { get; set; }
/// <summary>
/// Whether to generate a TSQL script for the operation instead of detaching the database
/// </summary>
public bool GenerateScript { get; set; }
}
public class DetachDatabaseRequest
{
public static readonly RequestType<DetachDatabaseRequestParams, string> Type = RequestType<DetachDatabaseRequestParams, string>.Create("objectManagement/detachDatabase");
}
}