mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-17 02:51:45 -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
|
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
|
// put appropriate database name since connection passed was to master
|
||||||
metadata.DatabaseName = parameters.DatabaseName;
|
metadata.DatabaseName = parameters.DatabaseName;
|
||||||
|
|||||||
@@ -35,6 +35,11 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices.Contracts
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string DatabaseName { get; set; }
|
public string DatabaseName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Target location for this task
|
||||||
|
/// </summary>
|
||||||
|
public string TargetLocation { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Task name which defines the type of the task (e.g. CreateDatabase, Backup)
|
/// Task name which defines the type of the task (e.g. CreateDatabase, Backup)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -474,6 +474,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices
|
|||||||
Description = TaskMetadata.Description,
|
Description = TaskMetadata.Description,
|
||||||
TaskExecutionMode = TaskMetadata.TaskExecutionMode,
|
TaskExecutionMode = TaskMetadata.TaskExecutionMode,
|
||||||
IsCancelable = this.TaskToCancel != null,
|
IsCancelable = this.TaskToCancel != null,
|
||||||
|
TargetLocation = TaskMetadata.TargetLocation,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,11 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string DatabaseName { get; set; }
|
public string DatabaseName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Target location of this task
|
||||||
|
/// </summary>
|
||||||
|
public string TargetLocation { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data required to perform the task
|
/// Data required to perform the task
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -59,7 +64,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices
|
|||||||
/// <param name="taskOperation">Task operation</param>
|
/// <param name="taskOperation">Task operation</param>
|
||||||
/// <param name="connectionService">Connection Service</param>
|
/// <param name="connectionService">Connection Service</param>
|
||||||
/// <returns>Task metadata</returns>
|
/// <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();
|
TaskMetadata taskMetadata = new TaskMetadata();
|
||||||
ConnectionInfo connInfo;
|
ConnectionInfo connInfo;
|
||||||
@@ -90,6 +95,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices
|
|||||||
|
|
||||||
taskMetadata.TaskOperation = taskOperation;
|
taskMetadata.TaskOperation = taskOperation;
|
||||||
taskMetadata.OwnerUri = requestParam.OwnerUri;
|
taskMetadata.OwnerUri = requestParam.OwnerUri;
|
||||||
|
taskMetadata.TargetLocation = targetLocation;
|
||||||
|
|
||||||
return taskMetadata;
|
return taskMetadata;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user