Feature/serialization exe (#442)

* Initial changes to have serialization generate its own .exe

* Removed additional project from sln file

* remove all references to removed temporary project

* Moved shared contracts into own dll and fixed imports. Addressed PR comments

* Undid having a separate contracts project since that'll be a task for later on. Moved dbcellvalue and saveresultsrequest to Hosting, where they will be imported and shared by the service layer and serialization projects

* Switched backslashes in project reference in csproj file to forward slashes for consistency

* Moved necessary contracts back to service layer. Refactored CommandOptions to reduce code duplication. Addressed miscellaneous PR suggestions

* Accidentally left these files out of previous commit

* Initialized loggers for serialization and credentials with the logging directory provided by the cmd line arg, if there is one

* Changed default log directory paths for serialization and credentials. Removed unnecessary cast and added a copyright

* Changed name of generated executable for serialization service

* removed unnecessary object cast

* removing unnecessary imports and addressing other PR comments
This commit is contained in:
Henry Phan
2017-09-05 16:21:42 -07:00
committed by GitHub
parent 22ccac98ae
commit 784f4c5d05
26 changed files with 425 additions and 177 deletions

View File

@@ -3,7 +3,6 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System;
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts

View File

@@ -0,0 +1,57 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts
{
/// <summary>
/// Class used for storing results and how the results are to be serialized
/// </summary>
public class SaveResultsInfo
{
/// <summary>
/// String representation of the type that service is supposed to serialize to
/// E.g. "json" or "csv"
/// </summary>
public string SaveFormat { get; set; }
/// <summary>
/// Path to file that the serialized results will be stored in
/// </summary>
public string SavePath { get; set; }
/// <summary>
/// Results that are to be serialized into 'SaveFormat' format
/// </summary>
public DbCellValue[][] Rows { get; set; }
/// <summary>
/// Whether the current set of Rows passed in is the last for this file
// </summary>
public bool IsLast { get; set; }
/// <summary>
/// Constructor
/// </summary>
public SaveResultsInfo(string saveFormat,
string savePath,
DbCellValue[][] rows,
bool isLast)
{
this.SaveFormat = saveFormat;
this.SavePath = savePath;
this.Rows = Rows;
this.IsLast = isLast;
}
}
public class SaveAsRequest
{
public static readonly
RequestType<SaveResultsInfo, SaveResultRequestResult> Type =
RequestType<SaveResultsInfo, SaveResultRequestResult>.Create("query/saveAs");
}
}

View File

@@ -3,11 +3,8 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.DataStorage

View File

@@ -3,12 +3,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Xml;
using Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.DataStorage
{

View File

@@ -4,8 +4,6 @@
//
using System;
using System.Collections.Concurrent;
using System.Data.Common;
using System.Data.SqlClient;
using System.IO;
using System.Threading.Tasks;
using Microsoft.SqlTools.ServiceLayer.Connection;