mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 18:47:57 -05:00
DacFx import/export (#728)
Adding DacFx import/export/deploy/extract functionality
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.TaskServices;
|
||||
using Microsoft.SqlTools.ServiceLayer.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.DacFx.Contracts
|
||||
{
|
||||
/// <summary>
|
||||
/// Parameters for a DacFx request.
|
||||
/// </summary>
|
||||
public abstract class DacFxParams : IScriptableRequestParams
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets package filepath
|
||||
/// </summary>
|
||||
public string PackageFilePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets name for database
|
||||
/// </summary>
|
||||
public string DatabaseName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Connection uri
|
||||
/// </summary>
|
||||
public string OwnerUri { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Executation mode for the operation. Default is execution
|
||||
/// </summary>
|
||||
public TaskExecutionMode TaskExecutionMode { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parameters returned from a DacFx request.
|
||||
/// </summary>
|
||||
public class DacFxResult : ResultStatus
|
||||
{
|
||||
public string OperationId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.TaskServices;
|
||||
using Microsoft.SqlTools.ServiceLayer.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.DacFx.Contracts
|
||||
{
|
||||
/// <summary>
|
||||
/// Parameters for a DacFx deploy request.
|
||||
/// </summary>
|
||||
public class DeployParams : DacFxParams
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets if upgrading existing database
|
||||
/// </summary>
|
||||
public bool UpgradeExisting { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the DacFx deploy request type
|
||||
/// </summary>
|
||||
class DeployRequest
|
||||
{
|
||||
public static readonly RequestType<DeployParams, DacFxResult> Type =
|
||||
RequestType<DeployParams, DacFxResult>.Create("dacfx/deploy");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.TaskServices;
|
||||
using Microsoft.SqlTools.ServiceLayer.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.DacFx.Contracts
|
||||
{
|
||||
/// <summary>
|
||||
/// Parameters for a DacFx export request.
|
||||
/// </summary>
|
||||
public class ExportParams : DacFxParams
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the DacFx export request type
|
||||
/// </summary>
|
||||
class ExportRequest
|
||||
{
|
||||
public static readonly RequestType<ExportParams, DacFxResult> Type =
|
||||
RequestType<ExportParams, DacFxResult>.Create("dacfx/export");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.TaskServices;
|
||||
using Microsoft.SqlTools.ServiceLayer.Utility;
|
||||
using System;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.DacFx.Contracts
|
||||
{
|
||||
/// <summary>
|
||||
/// Parameters for a DacFx extract request.
|
||||
/// </summary>
|
||||
public class ExtractParams : DacFxParams
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the string identifier for the DAC application
|
||||
/// </summary>
|
||||
public string ApplicationName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the version of the DAC application
|
||||
/// </summary>
|
||||
public Version ApplicationVersion { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the DacFx extract request type
|
||||
/// </summary>
|
||||
class ExtractRequest
|
||||
{
|
||||
public static readonly RequestType<ExtractParams, DacFxResult> Type =
|
||||
RequestType<ExtractParams, DacFxResult>.Create("dacfx/extract");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.TaskServices;
|
||||
using Microsoft.SqlTools.ServiceLayer.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.DacFx.Contracts
|
||||
{
|
||||
/// <summary>
|
||||
/// Parameters for a DacFx import request.
|
||||
/// </summary>
|
||||
public class ImportParams : DacFxParams
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Defines the DacFx import request type
|
||||
/// </summary>
|
||||
class ImportRequest
|
||||
{
|
||||
public static readonly RequestType<ImportParams, DacFxResult> Type =
|
||||
RequestType<ImportParams, DacFxResult>.Create("dacfx/import");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user