mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
Show file location for dacfx extract and export (#936)
* show file location for dacfx extract and export * Add TargetDestination field to TaskInfo * remove setting database and server name to null if there's packageFilePath * remove unnecessary parameter
This commit is contained in:
@@ -227,7 +227,9 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx
|
||||
{
|
||||
try
|
||||
{
|
||||
TaskMetadata metadata = TaskMetadata.Create(parameters, taskName, operation, ConnectionServiceInstance);
|
||||
// show file location for export and extract operations
|
||||
string targetLocation = (operation is ExportOperation || operation is ExtractOperation) ? parameters.PackageFilePath : null;
|
||||
TaskMetadata metadata = TaskMetadata.Create(parameters, taskName, operation, ConnectionServiceInstance, targetLocation);
|
||||
|
||||
// put appropriate database name since connection passed was to master
|
||||
metadata.DatabaseName = parameters.DatabaseName;
|
||||
|
||||
@@ -35,6 +35,11 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices.Contracts
|
||||
/// </summary>
|
||||
public string DatabaseName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Target location for this task
|
||||
/// </summary>
|
||||
public string TargetLocation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Task name which defines the type of the task (e.g. CreateDatabase, Backup)
|
||||
/// </summary>
|
||||
|
||||
@@ -474,6 +474,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices
|
||||
Description = TaskMetadata.Description,
|
||||
TaskExecutionMode = TaskMetadata.TaskExecutionMode,
|
||||
IsCancelable = this.TaskToCancel != null,
|
||||
TargetLocation = TaskMetadata.TargetLocation,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,11 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices
|
||||
/// </summary>
|
||||
public string DatabaseName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Target location of this task
|
||||
/// </summary>
|
||||
public string TargetLocation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Data required to perform the task
|
||||
/// </summary>
|
||||
@@ -59,7 +64,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices
|
||||
/// <param name="taskOperation">Task operation</param>
|
||||
/// <param name="connectionService">Connection Service</param>
|
||||
/// <returns>Task metadata</returns>
|
||||
public static TaskMetadata Create(IRequestParams requestParam, string taskName, ITaskOperation taskOperation, ConnectionService connectionService)
|
||||
public static TaskMetadata Create(IRequestParams requestParam, string taskName, ITaskOperation taskOperation, ConnectionService connectionService, string targetLocation = null)
|
||||
{
|
||||
TaskMetadata taskMetadata = new TaskMetadata();
|
||||
ConnectionInfo connInfo;
|
||||
@@ -90,6 +95,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices
|
||||
|
||||
taskMetadata.TaskOperation = taskOperation;
|
||||
taskMetadata.OwnerUri = requestParam.OwnerUri;
|
||||
taskMetadata.TargetLocation = targetLocation;
|
||||
|
||||
return taskMetadata;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user