mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-26 09:35:38 -05:00
Export to Markdown Support (#1705)
* Adding file writer for Markdown tables. No testing yet. * Unit tests for the markdown writer * Wiring up the factory and and request types * Wiring up changes for Markdown serialization in serialization service * Couple last minute tweaks * Changes as per PR comments * Revert temp testing code. 🙈 * Fluent assertions in SerializationServiceTests.cs Co-authored-by: Ben Russell <russellben@microsoft.com>
This commit is contained in:
@@ -84,7 +84,7 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts
|
||||
public string Delimiter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// either CR, CRLF or LF to seperate rows in CSV
|
||||
/// either CR, CRLF or LF to separate rows in CSV
|
||||
/// </summary>
|
||||
public string LineSeperator { get; set; }
|
||||
|
||||
@@ -123,6 +123,28 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts
|
||||
//TODO: define config for save as JSON
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parameters for saving results as a Markdown table
|
||||
/// </summary>
|
||||
public class SaveResultsAsMarkdownRequestParams : SaveResultsRequestParams
|
||||
{
|
||||
/// <summary>
|
||||
/// Encoding of the CSV file
|
||||
/// </summary>
|
||||
public string Encoding { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether to include column names as header for the table.
|
||||
/// </summary>
|
||||
public bool IncludeHeaders { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Character sequence to separate a each row in the table. Should be either CR, CRLF, or
|
||||
/// LF. If not provided, defaults to the system default line ending sequence.
|
||||
/// </summary>
|
||||
public string? LineSeparator { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parameters to save results as XML
|
||||
/// </summary>
|
||||
@@ -179,6 +201,16 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts
|
||||
RequestType<SaveResultsAsJsonRequestParams, SaveResultRequestResult> Type =
|
||||
RequestType<SaveResultsAsJsonRequestParams, SaveResultRequestResult>.Create("query/saveJson");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Request type to save results as a Markdown table
|
||||
/// </summary>
|
||||
public class SaveResultsAsMarkdownRequest
|
||||
{
|
||||
public static readonly
|
||||
RequestType<SaveResultsAsMarkdownRequestParams, SaveResultRequestResult> Type =
|
||||
RequestType<SaveResultsAsMarkdownRequestParams, SaveResultRequestResult>.Create("query/saveMarkdown");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Request type to save results as XML
|
||||
|
||||
Reference in New Issue
Block a user