DacFx import/export (#728)

Adding DacFx import/export/deploy/extract functionality
This commit is contained in:
kisantia
2018-11-27 16:10:46 -08:00
committed by GitHub
parent 7a47db8806
commit d5fd968b3c
17 changed files with 920 additions and 9 deletions

View File

@@ -0,0 +1,33 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlServer.Dac;
using Microsoft.SqlTools.ServiceLayer.DacFx.Contracts;
using Microsoft.SqlTools.ServiceLayer.TaskServices;
using Microsoft.SqlTools.Utility;
using System;
using System.Data.SqlClient;
using System.Diagnostics;
namespace Microsoft.SqlTools.ServiceLayer.DacFx
{
/// <summary>
/// Class to represent an in-progress extract operation
/// </summary>
class ExtractOperation : DacFxOperation
{
public ExtractParams Parameters { get; }
public ExtractOperation(ExtractParams parameters, SqlConnection sqlConnection): base(sqlConnection)
{
Validate.IsNotNull("parameters", parameters);
this.Parameters = parameters;
}
public override void Execute()
{
this.DacServices.Extract(this.Parameters.PackageFilePath, this.Parameters.DatabaseName, this.Parameters.ApplicationName, this.Parameters.ApplicationVersion, null, null, null, this.CancellationToken);
}
}
}