// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // using System; using Microsoft.SqlTools.ServiceLayer.Hosting.Protocol.Contracts; namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts { /// /// Parameters for the save results request /// public class SaveResultsRequestParams { /// /// The path of the file to save results in /// public string FilePath { get; set; } /// /// Index of the batch to get the results from /// public int BatchIndex { get; set; } /// /// Index of the result set to get the results from /// public int ResultSetIndex { get; set; } /// /// URI for the editor that called save results /// public string OwnerUri { get; set; } } /// /// Parameters to save results as CSV /// public class SaveResultsAsCsvRequestParams: SaveResultsRequestParams{ /// /// CSV - Write values in quotes /// public Boolean ValueInQuotes { get; set; } /// /// The encoding of the file to save results in /// public string FileEncoding { get; set; } /// /// Include headers of columns in CSV /// public bool IncludeHeaders { get; set; } } /// /// Parameters to save results as JSON /// public class SaveResultsAsJsonRequestParams: SaveResultsRequestParams{ //TODO: define config for save as JSON } /// /// Parameters for the save results result /// public class SaveResultRequestResult { /// /// Error messages for saving to file. /// public string Messages { get; set; } } /// /// Request type to save results as CSV /// public class SaveResultsAsCsvRequest { public static readonly RequestType Type = RequestType.Create("query/saveCsv"); } /// /// Request type to save results as JSON /// public class SaveResultsAsJsonRequest { public static readonly RequestType Type = RequestType.Create("query/saveJson"); } }