mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 18:47:57 -05:00
Add DacFx Generate Deploy Script operation (#759)
* Adding DacFx Generate Deploy Script operation
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
using Microsoft.SqlServer.Dac;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection;
|
||||
using Microsoft.SqlTools.ServiceLayer.TaskServices;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
using System;
|
||||
@@ -27,14 +28,14 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx
|
||||
|
||||
public SqlTask SqlTask { get; set; }
|
||||
|
||||
protected SqlConnection SqlConnection { get; private set; }
|
||||
protected string ConnectionString { get; private set; }
|
||||
|
||||
protected DacServices DacServices { get; private set; }
|
||||
|
||||
protected DacFxOperation(SqlConnection sqlConnection)
|
||||
protected DacFxOperation(ConnectionInfo connInfo)
|
||||
{
|
||||
Validate.IsNotNull("sqlConnection", sqlConnection);
|
||||
this.SqlConnection = sqlConnection;
|
||||
Validate.IsNotNull("connectionInfo", connInfo);
|
||||
this.ConnectionString = ConnectionService.BuildConnectionString(connInfo.ConnectionDetails);
|
||||
this.OperationId = Guid.NewGuid().ToString();
|
||||
}
|
||||
|
||||
@@ -78,7 +79,7 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx
|
||||
|
||||
try
|
||||
{
|
||||
this.DacServices = new DacServices(this.SqlConnection.ConnectionString);
|
||||
this.DacServices = new DacServices(this.ConnectionString);
|
||||
Execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
Reference in New Issue
Block a user