Move managed parser into its own project (test code coverage) (#774)

* Created New ManagedBatchParser project in .NetStandard

* Addressing PR Comments

* Resolve 'No Repository' warning.

* Move batch parser tests to integrations test project

* Fix SLN file
This commit is contained in:
Karl Burtram
2019-02-07 20:13:03 -08:00
committed by GitHub
parent 0a172f3c8e
commit 022282800a
92 changed files with 2471 additions and 6391 deletions

View File

@@ -61,6 +61,9 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.SqlTools.Hosting.Contracts", "src\Microsoft.SqlTools.Hosting.Contracts\Microsoft.SqlTools.Hosting.Contracts.csproj", "{BE04C532-C9AE-4C32-9283-F6629112228B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.SqlTools.ServiceLayer", "src\Microsoft.SqlTools.ServiceLayer\Microsoft.SqlTools.ServiceLayer.csproj", "{835EDEB4-289B-4D6D-A9A0-609E43A87D6E}"
ProjectSection(ProjectDependencies) = postProject
{3F82F298-700A-48DF-8A69-D048DFBA782C} = {3F82F298-700A-48DF-8A69-D048DFBA782C}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.SqlTools.Hosting.UnitTests", "test\Microsoft.SqlTools.Hosting.UnitTests\Microsoft.SqlTools.Hosting.UnitTests.csproj", "{BA3C9622-ABFF-45A2-91AA-CC5189083256}"
EndProject
@@ -90,6 +93,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.SqlTools.Hosting.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TVFSample", "test\TVFSample\TVFSample.csproj", "{1FC10261-EC0D-416A-9B66-C55F0A34968C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.SqlTools.ManagedBatchParser", "src\Microsoft.SqlTools.ManagedBatchParser\Microsoft.SqlTools.ManagedBatchParser.csproj", "{3F82F298-700A-48DF-8A69-D048DFBA782C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -217,6 +222,12 @@ Global
{1FC10261-EC0D-416A-9B66-C55F0A34968C}.Integration|Any CPU.Build.0 = Release|Any CPU
{1FC10261-EC0D-416A-9B66-C55F0A34968C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1FC10261-EC0D-416A-9B66-C55F0A34968C}.Release|Any CPU.Build.0 = Release|Any CPU
{3F82F298-700A-48DF-8A69-D048DFBA782C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3F82F298-700A-48DF-8A69-D048DFBA782C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3F82F298-700A-48DF-8A69-D048DFBA782C}.Integration|Any CPU.ActiveCfg = Debug|Any CPU
{3F82F298-700A-48DF-8A69-D048DFBA782C}.Integration|Any CPU.Build.0 = Debug|Any CPU
{3F82F298-700A-48DF-8A69-D048DFBA782C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3F82F298-700A-48DF-8A69-D048DFBA782C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -244,6 +255,7 @@ Global
{8EE5B06A-2EB2-4A47-812D-1D5B98D0F49A} = {AB9CA2B8-6F70-431C-8A1D-67479D8A7BE4}
{EF02F89F-417E-4A40-B7E6-B102EE2DF24D} = {2BBD7364-054F-4693-97CD-1C395E3E84A9}
{1FC10261-EC0D-416A-9B66-C55F0A34968C} = {AB9CA2B8-6F70-431C-8A1D-67479D8A7BE4}
{3F82F298-700A-48DF-8A69-D048DFBA782C} = {2BBD7364-054F-4693-97CD-1C395E3E84A9}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B31CDF4B-2851-45E5-8C5F-BE97125D9DD8}

View File

@@ -5,7 +5,7 @@
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
{
internal enum BatchParserAction
public enum BatchParserAction
{
Continue = 0,
Abort = 1

View File

@@ -7,7 +7,7 @@ using System;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
{
internal sealed class BatchParserException : Exception
public sealed class BatchParserException : Exception
{
const string ErrorCodeName = "ErrorCode";
const string BeginName = "Begin";

View File

@@ -10,6 +10,7 @@ using System.IO;
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
using System.Globalization;
using System.Diagnostics;
using Microsoft.SqlTools.ManagedBatchParser;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
{

View File

@@ -5,7 +5,7 @@
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
{
internal enum ErrorCode
public enum ErrorCode
{
ErrorCodeBase = 0,

View File

@@ -11,13 +11,14 @@ using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection;
using Microsoft.SqlTools.Utility;
using Microsoft.SqlTools.ManagedBatchParser;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
{
/// <summary>
/// Single batch of SQL command
/// </summary>
internal class Batch
public class Batch
{
#region Private methods

View File

@@ -5,13 +5,14 @@
using System;
using System.Data.SqlClient;
using Microsoft.SqlTools.ManagedBatchParser;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
{
/// <summary>
/// Error totalAffectedRows for a Batch
/// </summary>
internal class BatchErrorEventArgs : EventArgs
public class BatchErrorEventArgs : EventArgs
{
#region Private Fields
private string message = string.Empty;

View File

@@ -11,7 +11,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
/// <summary>
/// Event args for notification about non-error message
/// </summary>
internal class BatchMessageEventArgs : EventArgs
public class BatchMessageEventArgs : EventArgs
{
private readonly string message = string.Empty;
private readonly string detailedMessage = string.Empty;

View File

@@ -10,7 +10,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
/// <summary>
/// Class that parses queries into batches
/// </summary>
internal class BatchParser :
public class BatchParser :
ICommandHandler,
IVariableResolver
{
@@ -153,7 +153,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
throw new NotImplementedException("The method or operation is not implemented.");
}
internal void DisableVariableSubstitution()
public void DisableVariableSubstitution()
{
variableSubstitutionDisabled = true;
}

View File

@@ -8,7 +8,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
/// <summary>
/// Class associated with batch parser execution errors
/// </summary>
internal class BatchParserExecutionErrorEventArgs : BatchErrorEventArgs
public class BatchParserExecutionErrorEventArgs : BatchErrorEventArgs
{
private readonly ScriptMessageType messageType;

View File

@@ -10,7 +10,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
/// <summary>
/// Class associated with batch parser execution finished event
/// </summary>
internal class BatchParserExecutionFinishedEventArgs : EventArgs
public class BatchParserExecutionFinishedEventArgs : EventArgs
{
private readonly Batch batch = null;

View File

@@ -11,7 +11,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
/// <summary>
/// Class associated with batch parser execution start event
/// </summary>
internal class BatchParserExecutionStartEventArgs : EventArgs
public class BatchParserExecutionStartEventArgs : EventArgs
{
private readonly Batch batch = null;

View File

@@ -8,13 +8,14 @@ using System.Collections.Generic;
using System.Data.SqlClient;
using System.Globalization;
using System.IO;
using Microsoft.SqlTools.ManagedBatchParser;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
{
/// <summary>
/// Class for handling SQL CMD by Batch Parser
/// </summary>
internal class BatchParserSqlCmd : BatchParser
public class BatchParserSqlCmd : BatchParser
{
/// <summary>
/// The internal variables that can be used in SqlCommand substitution.
@@ -37,13 +38,13 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
// nothing
}
internal ConnectionChangedDelegate ConnectionChanged
public ConnectionChangedDelegate ConnectionChanged
{
get { return connectionChangedDelegate; }
set { connectionChangedDelegate = value; }
}
internal ErrorActionChangedDelegate ErrorActionChanged
public ErrorActionChangedDelegate ErrorActionChanged
{
get { return errorActionChangedDelegate; }
set { errorActionChangedDelegate = value; }

View File

@@ -11,7 +11,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
/// <summary>
/// Class associated with setting batch results
/// </summary>
internal class BatchResultSetEventArgs : EventArgs
public class BatchResultSetEventArgs : EventArgs
{
private readonly IDataReader dataReader = null;

View File

@@ -12,6 +12,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Text;
using Microsoft.SqlTools.ManagedBatchParser;
using Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection;
using Microsoft.SqlTools.Utility;
@@ -20,7 +21,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
/// <summary>
/// Execution engine class which executed the parsed batches
/// </summary>
internal class ExecutionEngine : IDisposable
public class ExecutionEngine : IDisposable
{
#region Private fields

View File

@@ -8,7 +8,7 @@ using Microsoft.SqlTools.Utility;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
{
internal class ExecutionEngineConditions
public class ExecutionEngineConditions
{
#region Private fields

View File

@@ -7,7 +7,7 @@ using System;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
{
internal interface IBatchEventsHandler
public interface IBatchEventsHandler
{
/// <summary>
/// fired when there is an error message from the server

View File

@@ -10,7 +10,7 @@ using System.Data.SqlClient;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
{
internal class ScriptExecutionArgs : EventArgs
public class ScriptExecutionArgs : EventArgs
{
private IDbConnection connection;
private IBatchEventsHandler batchEventHandlers;

View File

@@ -7,7 +7,7 @@ using System;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
{
internal class ScriptExecutionFinishedEventArgs : EventArgs
public class ScriptExecutionFinishedEventArgs : EventArgs
{
internal ScriptExecutionFinishedEventArgs(ScriptExecutionResult result)
{

View File

@@ -8,7 +8,7 @@ using System;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
{
[Flags]
internal enum ScriptExecutionResult
public enum ScriptExecutionResult
{
Success = 0x1,
Failure = 0x2,

View File

@@ -5,7 +5,7 @@
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
{
internal enum ScriptMessageType
public enum ScriptMessageType
{
FatalError,
Error,

View File

@@ -6,7 +6,7 @@
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
{
[System.Flags]
internal enum ShowPlanType
public enum ShowPlanType
{
None = 0x0,
ActualExecutionShowPlan = 0x1,

View File

@@ -5,7 +5,7 @@
namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode
{
internal struct TextSpan
public struct TextSpan
{
public int iEndIndex;
public int iEndLine;

View File

@@ -7,7 +7,7 @@ using System.IO;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
{
internal interface ICommandHandler
public interface ICommandHandler
{
BatchParserAction Go(TextBlock batch, int repeatCount);
BatchParserAction OnError(Token token, OnErrorAction action);

View File

@@ -5,7 +5,7 @@
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
{
internal interface IVariableResolver
public interface IVariableResolver
{
string GetVariable(PositionStruct pos, string name);
void SetVariable(PositionStruct pos, string name, string value);

View File

@@ -8,13 +8,14 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using Microsoft.SqlTools.ManagedBatchParser;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
{
/// <summary>
/// Lexer class for the SMO Batch Parser
/// </summary>
internal sealed class Lexer : IDisposable
public sealed class Lexer : IDisposable
{
private LexerInput currentInput;
private bool popInputAtNextConsume;

View File

@@ -5,7 +5,7 @@
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
{
internal enum LexerTokenType
public enum LexerTokenType
{
None,
Text,

View File

@@ -11,7 +11,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
/// This class gives information about lines being parsed by
/// the Batch Parser
/// </summary>
class LineInfo
public class LineInfo
{
private IEnumerable<Token> tokens;
private IEnumerable<VariableReference> variableRefs;

View File

@@ -5,7 +5,7 @@
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
{
internal enum OnErrorAction
public enum OnErrorAction
{
Ignore = 0,
Exit = 1,

View File

@@ -10,13 +10,14 @@ using System.Globalization;
using System.IO;
using System.Security;
using System.Text;
using Microsoft.SqlTools.ManagedBatchParser;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
{
/// <summary>
/// The Parser class on which the Batch Parser is based on
/// </summary>
internal sealed class Parser : IDisposable
public sealed class Parser : IDisposable
{
private readonly ICommandHandler commandHandler;
private Lexer lexer;
@@ -224,7 +225,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
return false;
}
internal void Parse()
public void Parse()
{
Accept();
ParseLines();

View File

@@ -8,7 +8,7 @@ using System;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
{
[Serializable]
internal struct PositionStruct
public struct PositionStruct
{
private readonly int line;
private readonly int column;

View File

@@ -3,12 +3,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System.Text;
using System.Collections.Generic;
using System.Text;
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
{
internal class TextBlock
public class TextBlock
{
private readonly Parser parser;
private readonly IEnumerable<Token> tokens;
@@ -63,6 +63,5 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
lineInfo = new LineInfo(tokens, variableRefs);
text = sb.ToString();
}
}
}

View File

@@ -5,7 +5,7 @@
namespace Microsoft.SqlTools.ServiceLayer.BatchParser
{
internal sealed class Token
public sealed class Token
{
/// <summary>
/// Token class used by the lexer in Batch Parser

View File

@@ -8,7 +8,7 @@ namespace Microsoft.SqlTools.ServiceLayer.BatchParser
/// <summary>
/// Class for reference of variables used by the lexer
/// </summary>
internal sealed class VariableReference
public sealed class VariableReference
{
/// <summary>
/// Constructor method for VariableReference class

View File

@@ -0,0 +1,381 @@
// WARNING:
// This file was generated by the Microsoft DataWarehouse String Resource Tool 1.37.0.0
// from information in sr.strings
// DO NOT MODIFY THIS FILE'S CONTENTS, THEY WILL BE OVERWRITTEN
//
namespace Microsoft.SqlTools.ManagedBatchParser
{
using System;
using System.Reflection;
using System.Resources;
using System.Globalization;
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class SR
{
protected SR()
{ }
public static CultureInfo Culture
{
get
{
return Keys.Culture;
}
set
{
Keys.Culture = value;
}
}
public static string EE_BatchSqlMessageNoProcedureInfo
{
get
{
return Keys.GetString(Keys.EE_BatchSqlMessageNoProcedureInfo);
}
}
public static string EE_BatchSqlMessageWithProcedureInfo
{
get
{
return Keys.GetString(Keys.EE_BatchSqlMessageWithProcedureInfo);
}
}
public static string EE_BatchSqlMessageNoLineInfo
{
get
{
return Keys.GetString(Keys.EE_BatchSqlMessageNoLineInfo);
}
}
public static string EE_BatchError_Exception
{
get
{
return Keys.GetString(Keys.EE_BatchError_Exception);
}
}
public static string EE_BatchExecutionInfo_RowsAffected
{
get
{
return Keys.GetString(Keys.EE_BatchExecutionInfo_RowsAffected);
}
}
public static string EE_ExecutionNotYetCompleteError
{
get
{
return Keys.GetString(Keys.EE_ExecutionNotYetCompleteError);
}
}
public static string EE_ScriptError_Error
{
get
{
return Keys.GetString(Keys.EE_ScriptError_Error);
}
}
public static string EE_ScriptError_ParsingSyntax
{
get
{
return Keys.GetString(Keys.EE_ScriptError_ParsingSyntax);
}
}
public static string EE_ScriptError_FatalError
{
get
{
return Keys.GetString(Keys.EE_ScriptError_FatalError);
}
}
public static string EE_ExecutionInfo_FinalizingLoop
{
get
{
return Keys.GetString(Keys.EE_ExecutionInfo_FinalizingLoop);
}
}
public static string EE_ExecutionInfo_QueryCancelledbyUser
{
get
{
return Keys.GetString(Keys.EE_ExecutionInfo_QueryCancelledbyUser);
}
}
public static string EE_BatchExecutionError_Halting
{
get
{
return Keys.GetString(Keys.EE_BatchExecutionError_Halting);
}
}
public static string EE_BatchExecutionError_Ignoring
{
get
{
return Keys.GetString(Keys.EE_BatchExecutionError_Ignoring);
}
}
public static string EE_ExecutionInfo_InitializingLoop
{
get
{
return Keys.GetString(Keys.EE_ExecutionInfo_InitializingLoop);
}
}
public static string EE_ExecutionError_CommandNotSupported
{
get
{
return Keys.GetString(Keys.EE_ExecutionError_CommandNotSupported);
}
}
public static string EE_ExecutionError_VariableNotFound
{
get
{
return Keys.GetString(Keys.EE_ExecutionError_VariableNotFound);
}
}
public static string BatchParserWrapperExecutionEngineError
{
get
{
return Keys.GetString(Keys.BatchParserWrapperExecutionEngineError);
}
}
public static string BatchParserWrapperExecutionError
{
get
{
return Keys.GetString(Keys.BatchParserWrapperExecutionError);
}
}
public static string BatchParserWrapperExecutionEngineBatchMessage
{
get
{
return Keys.GetString(Keys.BatchParserWrapperExecutionEngineBatchMessage);
}
}
public static string BatchParserWrapperExecutionEngineBatchResultSetProcessing
{
get
{
return Keys.GetString(Keys.BatchParserWrapperExecutionEngineBatchResultSetProcessing);
}
}
public static string BatchParserWrapperExecutionEngineBatchResultSetFinished
{
get
{
return Keys.GetString(Keys.BatchParserWrapperExecutionEngineBatchResultSetFinished);
}
}
public static string BatchParserWrapperExecutionEngineBatchCancelling
{
get
{
return Keys.GetString(Keys.BatchParserWrapperExecutionEngineBatchCancelling);
}
}
public static string EE_ScriptError_Warning
{
get
{
return Keys.GetString(Keys.EE_ScriptError_Warning);
}
}
public static string TroubleshootingAssistanceMessage
{
get
{
return Keys.GetString(Keys.TroubleshootingAssistanceMessage);
}
}
public static string BatchParser_CircularReference
{
get
{
return Keys.GetString(Keys.BatchParser_CircularReference);
}
}
public static string BatchParser_CommentNotTerminated
{
get
{
return Keys.GetString(Keys.BatchParser_CommentNotTerminated);
}
}
public static string BatchParser_StringNotTerminated
{
get
{
return Keys.GetString(Keys.BatchParser_StringNotTerminated);
}
}
public static string BatchParser_IncorrectSyntax
{
get
{
return Keys.GetString(Keys.BatchParser_IncorrectSyntax);
}
}
public static string BatchParser_VariableNotDefined
{
get
{
return Keys.GetString(Keys.BatchParser_VariableNotDefined);
}
}
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Keys
{
static ResourceManager resourceManager = new ResourceManager("Microsoft.SqlTools.ManagedBatchParser.Localization.SR", typeof(SR).GetTypeInfo().Assembly);
static CultureInfo _culture = null;
public const string EE_BatchSqlMessageNoProcedureInfo = "EE_BatchSqlMessageNoProcedureInfo";
public const string EE_BatchSqlMessageWithProcedureInfo = "EE_BatchSqlMessageWithProcedureInfo";
public const string EE_BatchSqlMessageNoLineInfo = "EE_BatchSqlMessageNoLineInfo";
public const string EE_BatchError_Exception = "EE_BatchError_Exception";
public const string EE_BatchExecutionInfo_RowsAffected = "EE_BatchExecutionInfo_RowsAffected";
public const string EE_ExecutionNotYetCompleteError = "EE_ExecutionNotYetCompleteError";
public const string EE_ScriptError_Error = "EE_ScriptError_Error";
public const string EE_ScriptError_ParsingSyntax = "EE_ScriptError_ParsingSyntax";
public const string EE_ScriptError_FatalError = "EE_ScriptError_FatalError";
public const string EE_ExecutionInfo_FinalizingLoop = "EE_ExecutionInfo_FinalizingLoop";
public const string EE_ExecutionInfo_QueryCancelledbyUser = "EE_ExecutionInfo_QueryCancelledbyUser";
public const string EE_BatchExecutionError_Halting = "EE_BatchExecutionError_Halting";
public const string EE_BatchExecutionError_Ignoring = "EE_BatchExecutionError_Ignoring";
public const string EE_ExecutionInfo_InitializingLoop = "EE_ExecutionInfo_InitializingLoop";
public const string EE_ExecutionError_CommandNotSupported = "EE_ExecutionError_CommandNotSupported";
public const string EE_ExecutionError_VariableNotFound = "EE_ExecutionError_VariableNotFound";
public const string BatchParserWrapperExecutionEngineError = "BatchParserWrapperExecutionEngineError";
public const string BatchParserWrapperExecutionError = "BatchParserWrapperExecutionError";
public const string BatchParserWrapperExecutionEngineBatchMessage = "BatchParserWrapperExecutionEngineBatchMessage";
public const string BatchParserWrapperExecutionEngineBatchResultSetProcessing = "BatchParserWrapperExecutionEngineBatchResultSetProcessing";
public const string BatchParserWrapperExecutionEngineBatchResultSetFinished = "BatchParserWrapperExecutionEngineBatchResultSetFinished";
public const string BatchParserWrapperExecutionEngineBatchCancelling = "BatchParserWrapperExecutionEngineBatchCancelling";
public const string EE_ScriptError_Warning = "EE_ScriptError_Warning";
public const string TroubleshootingAssistanceMessage = "TroubleshootingAssistanceMessage";
public const string BatchParser_CircularReference = "BatchParser_CircularReference";
public const string BatchParser_CommentNotTerminated = "BatchParser_CommentNotTerminated";
public const string BatchParser_StringNotTerminated = "BatchParser_StringNotTerminated";
public const string BatchParser_IncorrectSyntax = "BatchParser_IncorrectSyntax";
public const string BatchParser_VariableNotDefined = "BatchParser_VariableNotDefined";
private Keys()
{ }
public static CultureInfo Culture
{
get
{
return _culture;
}
set
{
_culture = value;
}
}
public static string GetString(string key)
{
return resourceManager.GetString(key, _culture);
}
}
}
}

View File

@@ -0,0 +1,236 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype=">text/microsoft-resx</resheader>
<resheader name="version=">2.0</resheader>
<resheader name="reader=">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer=">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1="><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing=">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64=">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64=">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata=">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true=">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded=">
<xsd:element name="metadata=">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly=">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data=">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader=">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="EE_BatchSqlMessageNoProcedureInfo" xml:space="preserve">
<value>Msg {0}, Level {1}, State {2}, Line {3}</value>
<comment></comment>
</data>
<data name="EE_BatchSqlMessageWithProcedureInfo" xml:space="preserve">
<value>Msg {0}, Level {1}, State {2}, Procedure {3}, Line {4}</value>
<comment></comment>
</data>
<data name="EE_BatchSqlMessageNoLineInfo" xml:space="preserve">
<value>Msg {0}, Level {1}, State {2}</value>
<comment></comment>
</data>
<data name="EE_BatchError_Exception" xml:space="preserve">
<value>An error occurred while the batch was being processed. The error message is: {0}</value>
<comment></comment>
</data>
<data name="EE_BatchExecutionInfo_RowsAffected" xml:space="preserve">
<value>({0} row(s) affected)</value>
<comment></comment>
</data>
<data name="EE_ExecutionNotYetCompleteError" xml:space="preserve">
<value>The previous execution is not yet complete.</value>
<comment></comment>
</data>
<data name="EE_ScriptError_Error" xml:space="preserve">
<value>A scripting error occurred.</value>
<comment></comment>
</data>
<data name="EE_ScriptError_ParsingSyntax" xml:space="preserve">
<value>Incorrect syntax was encountered while {0} was being parsed.</value>
<comment></comment>
</data>
<data name="EE_ScriptError_FatalError" xml:space="preserve">
<value>A fatal error occurred.</value>
<comment></comment>
</data>
<data name="EE_ExecutionInfo_FinalizingLoop" xml:space="preserve">
<value>Batch execution completed {0} times...</value>
<comment></comment>
</data>
<data name="EE_ExecutionInfo_QueryCancelledbyUser" xml:space="preserve">
<value>You cancelled the query.</value>
<comment></comment>
</data>
<data name="EE_BatchExecutionError_Halting" xml:space="preserve">
<value>An error occurred while the batch was being executed.</value>
<comment></comment>
</data>
<data name="EE_BatchExecutionError_Ignoring" xml:space="preserve">
<value>An error occurred while the batch was being executed, but the error has been ignored.</value>
<comment></comment>
</data>
<data name="EE_ExecutionInfo_InitializingLoop" xml:space="preserve">
<value>Beginning execution loop</value>
<comment></comment>
</data>
<data name="EE_ExecutionError_CommandNotSupported" xml:space="preserve">
<value>Command {0} is not supported.</value>
<comment></comment>
</data>
<data name="EE_ExecutionError_VariableNotFound" xml:space="preserve">
<value>The variable {0} could not be found.</value>
<comment></comment>
</data>
<data name="BatchParserWrapperExecutionEngineError" xml:space="preserve">
<value>SQL Execution error: {0}</value>
<comment></comment>
</data>
<data name="BatchParserWrapperExecutionError" xml:space="preserve">
<value>Batch parser wrapper execution: {0} found... at line {1}: {2} Description: {3}</value>
<comment></comment>
</data>
<data name="BatchParserWrapperExecutionEngineBatchMessage" xml:space="preserve">
<value>Batch parser wrapper execution engine batch message received: Message: {0} Detailed message: {1}</value>
<comment></comment>
</data>
<data name="BatchParserWrapperExecutionEngineBatchResultSetProcessing" xml:space="preserve">
<value>Batch parser wrapper execution engine batch ResultSet processing: DataReader.FieldCount: {0} DataReader.RecordsAffected: {1}</value>
<comment></comment>
</data>
<data name="BatchParserWrapperExecutionEngineBatchResultSetFinished" xml:space="preserve">
<value>Batch parser wrapper execution engine batch ResultSet finished.</value>
<comment></comment>
</data>
<data name="BatchParserWrapperExecutionEngineBatchCancelling" xml:space="preserve">
<value>Canceling batch parser wrapper batch execution.</value>
<comment></comment>
</data>
<data name="EE_ScriptError_Warning" xml:space="preserve">
<value>Scripting warning.</value>
<comment></comment>
</data>
<data name="TroubleshootingAssistanceMessage" xml:space="preserve">
<value>For more information about this error, see the troubleshooting topics in the product documentation.</value>
<comment></comment>
</data>
<data name="BatchParser_CircularReference" xml:space="preserve">
<value>File '{0}' recursively included.</value>
<comment></comment>
</data>
<data name="BatchParser_CommentNotTerminated" xml:space="preserve">
<value>Missing end comment mark '*/'.</value>
<comment></comment>
</data>
<data name="BatchParser_StringNotTerminated" xml:space="preserve">
<value>Unclosed quotation mark after the character string.</value>
<comment></comment>
</data>
<data name="BatchParser_IncorrectSyntax" xml:space="preserve">
<value>Incorrect syntax was encountered while parsing '{0}'.</value>
<comment></comment>
</data>
<data name="BatchParser_VariableNotDefined" xml:space="preserve">
<value>Variable {0} is not defined.</value>
<comment></comment>
</data>
</root>

View File

@@ -0,0 +1,84 @@
# String resource file
#
# When processed by the String Resource Tool, this file generates
# both a .CS and a .RESX file with the same name as the file.
# The .CS file contains a class which can be used to access these
# string resources, including the ability to format in
# parameters, which are identified with the .NET {x} format
# (see String.Format help).
#
# Comments below assume the file name is SR.strings.
#
# Lines starting with a semicolon ";" are also treated as comments, but
# in a future version they will be extracted and made available in LocStudio
# Put your comments to localizers _before_ the string they apply to.
#
# SMO build specific comment
# after generating the .resx file, run srgen on it and get the .resx file
# please remember to also check that .resx in, along with the
# .strings and .cs files
[strings]
############################################################################
# DacFx Resources
EE_BatchSqlMessageNoProcedureInfo = Msg {0}, Level {1}, State {2}, Line {3}
EE_BatchSqlMessageWithProcedureInfo = Msg {0}, Level {1}, State {2}, Procedure {3}, Line {4}
EE_BatchSqlMessageNoLineInfo = Msg {0}, Level {1}, State {2}
EE_BatchError_Exception = An error occurred while the batch was being processed. The error message is: {0}
EE_BatchExecutionInfo_RowsAffected = ({0} row(s) affected)
EE_ExecutionNotYetCompleteError = The previous execution is not yet complete.
EE_ScriptError_Error = A scripting error occurred.
EE_ScriptError_ParsingSyntax = Incorrect syntax was encountered while {0} was being parsed.
EE_ScriptError_FatalError = A fatal error occurred.
EE_ExecutionInfo_FinalizingLoop = Batch execution completed {0} times...
EE_ExecutionInfo_QueryCancelledbyUser = You cancelled the query.
EE_BatchExecutionError_Halting = An error occurred while the batch was being executed.
EE_BatchExecutionError_Ignoring = An error occurred while the batch was being executed, but the error has been ignored.
EE_ExecutionInfo_InitializingLoop = Beginning execution loop
EE_ExecutionError_CommandNotSupported = Command {0} is not supported.
EE_ExecutionError_VariableNotFound = The variable {0} could not be found.
BatchParserWrapperExecutionEngineError = SQL Execution error: {0}
BatchParserWrapperExecutionError = Batch parser wrapper execution: {0} found... at line {1}: {2} Description: {3}
BatchParserWrapperExecutionEngineBatchMessage = Batch parser wrapper execution engine batch message received: Message: {0} Detailed message: {1}
BatchParserWrapperExecutionEngineBatchResultSetProcessing = Batch parser wrapper execution engine batch ResultSet processing: DataReader.FieldCount: {0} DataReader.RecordsAffected: {1}
BatchParserWrapperExecutionEngineBatchResultSetFinished = Batch parser wrapper execution engine batch ResultSet finished.
BatchParserWrapperExecutionEngineBatchCancelling = Canceling batch parser wrapper batch execution.
EE_ScriptError_Warning = Scripting warning.
TroubleshootingAssistanceMessage = For more information about this error, see the troubleshooting topics in the product documentation.
BatchParser_CircularReference = File '{0}' recursively included.
BatchParser_CommentNotTerminated = Missing end comment mark '*/'.
BatchParser_StringNotTerminated = Unclosed quotation mark after the character string.
BatchParser_IncorrectSyntax = Incorrect syntax was encountered while parsing '{0}'.
BatchParser_VariableNotDefined = Variable {0} is not defined.

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" original="sr.resx" source-language="en">
<body>
<trans-unit id="EE_BatchSqlMessageNoProcedureInfo">
<source>Msg {0}, Level {1}, State {2}, Line {3}</source>
<target state="new">Msg {0}, Level {1}, State {2}, Line {3}</target>
<note></note>
</trans-unit>
<trans-unit id="EE_BatchSqlMessageWithProcedureInfo">
<source>Msg {0}, Level {1}, State {2}, Procedure {3}, Line {4}</source>
<target state="new">Msg {0}, Level {1}, State {2}, Procedure {3}, Line {4}</target>
<note></note>
</trans-unit>
<trans-unit id="EE_BatchSqlMessageNoLineInfo">
<source>Msg {0}, Level {1}, State {2}</source>
<target state="new">Msg {0}, Level {1}, State {2}</target>
<note></note>
</trans-unit>
<trans-unit id="EE_BatchError_Exception">
<source>An error occurred while the batch was being processed. The error message is: {0}</source>
<target state="new">An error occurred while the batch was being processed. The error message is: {0}</target>
<note></note>
</trans-unit>
<trans-unit id="EE_BatchExecutionInfo_RowsAffected">
<source>({0} row(s) affected)</source>
<target state="new">({0} row(s) affected)</target>
<note></note>
</trans-unit>
<trans-unit id="EE_ExecutionNotYetCompleteError">
<source>The previous execution is not yet complete.</source>
<target state="new">The previous execution is not yet complete.</target>
<note></note>
</trans-unit>
<trans-unit id="EE_ScriptError_Error">
<source>A scripting error occurred.</source>
<target state="new">A scripting error occurred.</target>
<note></note>
</trans-unit>
<trans-unit id="EE_ScriptError_ParsingSyntax">
<source>Incorrect syntax was encountered while {0} was being parsed.</source>
<target state="new">Incorrect syntax was encountered while {0} was being parsed.</target>
<note></note>
</trans-unit>
<trans-unit id="EE_ScriptError_FatalError">
<source>A fatal error occurred.</source>
<target state="new">A fatal error occurred.</target>
<note></note>
</trans-unit>
<trans-unit id="EE_ExecutionInfo_FinalizingLoop">
<source>Batch execution completed {0} times...</source>
<target state="new">Batch execution completed {0} times...</target>
<note></note>
</trans-unit>
<trans-unit id="EE_ExecutionInfo_QueryCancelledbyUser">
<source>You cancelled the query.</source>
<target state="new">You cancelled the query.</target>
<note></note>
</trans-unit>
<trans-unit id="EE_BatchExecutionError_Halting">
<source>An error occurred while the batch was being executed.</source>
<target state="new">An error occurred while the batch was being executed.</target>
<note></note>
</trans-unit>
<trans-unit id="EE_BatchExecutionError_Ignoring">
<source>An error occurred while the batch was being executed, but the error has been ignored.</source>
<target state="new">An error occurred while the batch was being executed, but the error has been ignored.</target>
<note></note>
</trans-unit>
<trans-unit id="EE_ExecutionInfo_InitializingLoop">
<source>Beginning execution loop</source>
<target state="new">Beginning execution loop</target>
<note></note>
</trans-unit>
<trans-unit id="EE_ExecutionError_CommandNotSupported">
<source>Command {0} is not supported.</source>
<target state="new">Command {0} is not supported.</target>
<note></note>
</trans-unit>
<trans-unit id="EE_ExecutionError_VariableNotFound">
<source>The variable {0} could not be found.</source>
<target state="new">The variable {0} could not be found.</target>
<note></note>
</trans-unit>
<trans-unit id="BatchParserWrapperExecutionEngineError">
<source>SQL Execution error: {0}</source>
<target state="new">SQL Execution error: {0}</target>
<note></note>
</trans-unit>
<trans-unit id="BatchParserWrapperExecutionError">
<source>Batch parser wrapper execution: {0} found... at line {1}: {2} Description: {3}</source>
<target state="new">Batch parser wrapper execution: {0} found... at line {1}: {2} Description: {3}</target>
<note></note>
</trans-unit>
<trans-unit id="BatchParserWrapperExecutionEngineBatchMessage">
<source>Batch parser wrapper execution engine batch message received: Message: {0} Detailed message: {1}</source>
<target state="new">Batch parser wrapper execution engine batch message received: Message: {0} Detailed message: {1}</target>
<note></note>
</trans-unit>
<trans-unit id="BatchParserWrapperExecutionEngineBatchResultSetProcessing">
<source>Batch parser wrapper execution engine batch ResultSet processing: DataReader.FieldCount: {0} DataReader.RecordsAffected: {1}</source>
<target state="new">Batch parser wrapper execution engine batch ResultSet processing: DataReader.FieldCount: {0} DataReader.RecordsAffected: {1}</target>
<note></note>
</trans-unit>
<trans-unit id="BatchParserWrapperExecutionEngineBatchResultSetFinished">
<source>Batch parser wrapper execution engine batch ResultSet finished.</source>
<target state="new">Batch parser wrapper execution engine batch ResultSet finished.</target>
<note></note>
</trans-unit>
<trans-unit id="BatchParserWrapperExecutionEngineBatchCancelling">
<source>Canceling batch parser wrapper batch execution.</source>
<target state="new">Canceling batch parser wrapper batch execution.</target>
<note></note>
</trans-unit>
<trans-unit id="EE_ScriptError_Warning">
<source>Scripting warning.</source>
<target state="new">Scripting warning.</target>
<note></note>
</trans-unit>
<trans-unit id="TroubleshootingAssistanceMessage">
<source>For more information about this error, see the troubleshooting topics in the product documentation.</source>
<target state="new">For more information about this error, see the troubleshooting topics in the product documentation.</target>
<note></note>
</trans-unit>
<trans-unit id="BatchParser_CircularReference">
<source>File '{0}' recursively included.</source>
<target state="new">File '{0}' recursively included.</target>
<note></note>
</trans-unit>
<trans-unit id="BatchParser_CommentNotTerminated">
<source>Missing end comment mark '*/'.</source>
<target state="new">Missing end comment mark '*/'.</target>
<note></note>
</trans-unit>
<trans-unit id="BatchParser_StringNotTerminated">
<source>Unclosed quotation mark after the character string.</source>
<target state="new">Unclosed quotation mark after the character string.</target>
<note></note>
</trans-unit>
<trans-unit id="BatchParser_IncorrectSyntax">
<source>Incorrect syntax was encountered while parsing '{0}'.</source>
<target state="new">Incorrect syntax was encountered while parsing '{0}'.</target>
<note></note>
</trans-unit>
<trans-unit id="BatchParser_VariableNotDefined">
<source>Variable {0} is not defined.</source>
<target state="new">Variable {0} is not defined.</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
</PropertyGroup>
<ItemGroup>
<Folder Include="Localization\transXliff\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="150.18040.0-preview" />
<PackageReference Include="System.Data.SqlClient" Version="4.6.0" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\sr.resx" />
<None Include="Localization\sr.strings" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.SqlTools.Hosting\Microsoft.SqlTools.Hosting.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,43 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft.SqlTools.ManagedBatchParser")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Microsoft.SqlTools.ManagedBatchParser")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("82dd9738-2ad3-4eb3-9f80-18b594e03621")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer.UnitTests")]
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer.IntegrationTests")]
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer.Test.Common")]
[assembly: InternalsVisibleTo("MicrosoftSqlToolsServiceLayer")]
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ManagedBatchParser.UnitTests")]

View File

@@ -16,11 +16,11 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// cannot rely on the registry to supply override values therefore setting overrides must be made
/// by the top-of-the-stack
/// </summary>
internal sealed class AmbientSettings
public sealed class AmbientSettings
{
private const string LogicalContextName = "__LocalContextConfigurationName";
internal enum StreamBackingStore
public enum StreamBackingStore
{
// MemoryStream
Memory = 0,
@@ -49,7 +49,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
internal const string DoNotSerializeQueryStoreSettingsIndex = "DoNotSerializeQueryStoreSettings";
internal const string AlwaysEncryptedWizardMigrationIndex = "AlwaysEncryptedWizardMigration";
internal static AmbientData _defaultSettings;
public static AmbientData _defaultSettings;
static AmbientSettings()
{
@@ -291,25 +291,25 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
set { _configuration[ImportModelDatabaseIndex].Value = value; }
}
internal bool SupportAlwaysEncrypted
public bool SupportAlwaysEncrypted
{
get { return (bool)_configuration[SupportAlwaysEncryptedIndex].Value; }
set { _configuration[SupportAlwaysEncryptedIndex].Value = value; }
}
internal bool AlwaysEncryptedWizardMigration
public bool AlwaysEncryptedWizardMigration
{
get { return (bool)_configuration[AlwaysEncryptedWizardMigrationIndex].Value; }
set { _configuration[AlwaysEncryptedWizardMigrationIndex].Value = value; }
}
internal bool SkipObjectTypeBlocking
public bool SkipObjectTypeBlocking
{
get { return (bool)_configuration[SkipObjectTypeBlockingIndex].Value; }
set { _configuration[SkipObjectTypeBlockingIndex].Value = value; }
}
internal bool DoNotSerializeQueryStoreSettings
public bool DoNotSerializeQueryStoreSettings
{
get { return (bool)_configuration[DoNotSerializeQueryStoreSettingsIndex].Value; }
set { _configuration[DoNotSerializeQueryStoreSettingsIndex].Value = value; }

View File

@@ -17,7 +17,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// <summary>
/// This class caches server information for subsequent use
/// </summary>
internal class CachedServerInfo
public class CachedServerInfo
{
/// <summary>
/// Singleton service instance
@@ -115,7 +115,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// Internal constructor for testing purposes. For all code use, please use the <see cref="CachedServerInfo.Instance"/>
/// default instance.
/// </summary>
internal CachedServerInfo()
public CachedServerInfo()
{
_cache = new ConcurrentDictionary<CacheKey, CachedInfo>();
_cacheLock = new object();
@@ -175,7 +175,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
AddOrUpdateCache(builder, newState, cacheVar);
}
internal void AddOrUpdateCache(SqlConnectionStringBuilder builder, bool newState, CacheVariable cacheVar)
public void AddOrUpdateCache(SqlConnectionStringBuilder builder, bool newState, CacheVariable cacheVar)
{
Validate.IsNotNull(nameof(builder), builder);
Validate.IsNotNullOrWhitespaceString(nameof(builder) + ".DataSource", builder.DataSource);

View File

@@ -15,7 +15,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// the objects are just data-transfer-objects initialized during construction.
/// </summary>
[Serializable]
internal class DataSchemaError
public class DataSchemaError
{
internal const string DefaultPrefix = "SQL";
private const int MaxErrorCode = 99999;
@@ -182,7 +182,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
get { return FormatErrorCode(Prefix, ErrorCode); }
}
internal Boolean IsBuildErrorCodeDefined
public Boolean IsBuildErrorCodeDefined
{
get { return (ErrorCode != UndefinedErrorCode); }
}
@@ -190,9 +190,9 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// <summary>
/// true if this error is being displayed in ErrorList. More of an Accounting Mechanism to be used internally.
/// </summary>
internal bool IsOnDisplay { get; set; }
public bool IsOnDisplay { get; set; }
internal static string FormatErrorCode(string prefix, int code)
public static string FormatErrorCode(string prefix, int code)
{
return string.Format(
CultureInfo.InvariantCulture,

View File

@@ -15,7 +15,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// Wraps <see cref="IDbCommand"/> objects that could be a <see cref="SqlCommand"/> or
/// a <see cref="ReliableSqlConnection.ReliableSqlCommand"/>, providing common methods across both.
/// </summary>
internal sealed class DbCommandWrapper
public sealed class DbCommandWrapper
{
private readonly IDbCommand _command;
private readonly bool _isReliableCommand;

View File

@@ -5,7 +5,7 @@
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
{
internal enum ErrorSeverity
public enum ErrorSeverity
{
Unknown = 0,
Error,

View File

@@ -12,7 +12,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// top-of-stack API. Changes made to this context's AmbientData instance will
/// flow to lower in the stack while this object is not disposed.
/// </summary>
internal interface IStackSettingsContext : IDisposable
public interface IStackSettingsContext : IDisposable
{
AmbientSettings.AmbientData Settings { get; }
}

View File

@@ -16,7 +16,7 @@ using Microsoft.SqlServer.Management.Common;
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
{
internal static class ReliableConnectionHelper
public static class ReliableConnectionHelper
{
private const int PCU1BuildNumber = 2816;
public readonly static SqlConnectionStringBuilder BuilderWithDefaultApplicationName = new SqlConnectionStringBuilder("server=(local);");
@@ -705,6 +705,13 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
public Dictionary<string, object> Options { get; set; }
}
public class ClusterEndpoint
{
public string ServiceName;
public string IpAddress;
public int Port;
}
public static bool TryGetServerVersion(string connectionString, out ServerInfo serverInfo, string azureAccountToken)
{
serverInfo = null;
@@ -902,7 +909,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
public string DatabaseName;
}
internal static bool TryGetConnectionStringBuilder(string connectionString, out SqlConnectionStringBuilder builder)
public static bool TryGetConnectionStringBuilder(string connectionString, out SqlConnectionStringBuilder builder)
{
builder = null;

View File

@@ -35,9 +35,9 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// Provides a reliable way of opening connections to and executing commands
/// taking into account potential network unreliability and a requirement for connection retry.
/// </summary>
internal sealed partial class ReliableSqlConnection
public sealed partial class ReliableSqlConnection
{
internal class ReliableSqlCommand : DbCommand
public class ReliableSqlCommand : DbCommand
{
private const int Dummy = 0;
private readonly SqlCommand _command;
@@ -230,12 +230,12 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
_command.Prepare();
}
internal SqlCommand GetUnderlyingCommand()
public SqlCommand GetUnderlyingCommand()
{
return _command;
}
internal void ValidateConnectionIsSet()
public void ValidateConnectionIsSet()
{
if (_connection == null)
{

View File

@@ -41,7 +41,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// Provides a reliable way of opening connections to and executing commands
/// taking into account potential network unreliability and a requirement for connection retry.
/// </summary>
internal sealed partial class ReliableSqlConnection : DbConnection, IDisposable
public sealed partial class ReliableSqlConnection : DbConnection, IDisposable
{
private const string QueryAzureSessionId = "SELECT CONVERT(NVARCHAR(36), CONTEXT_INFO())";
@@ -493,7 +493,7 @@ SET NUMERIC_ROUNDABORT OFF;";
}
// Because retry loses session settings, cache session settings or reply if the settings are already cached.
internal Tuple<string, bool>[] CacheOrReplaySessionSettings(IDbCommand originalCommand, Tuple<string, bool>[] sessionSettings)
public Tuple<string, bool>[] CacheOrReplaySessionSettings(IDbCommand originalCommand, Tuple<string, bool>[] sessionSettings)
{
if (sessionSettings == null)
{

View File

@@ -8,7 +8,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// <summary>
/// Contains string resources used throughout ReliableConnection code.
/// </summary>
internal static class Resources
public static class Resources
{
internal static string AmbientSettingFormat
{
@@ -18,7 +18,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal static string ConnectionPassedToIsCloudShouldBeOpen
public static string ConnectionPassedToIsCloudShouldBeOpen
{
get
{
@@ -26,7 +26,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal static string ConnectionPropertyNotSet
public static string ConnectionPropertyNotSet
{
get
{
@@ -34,7 +34,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal static string ExceptionCannotBeRetried
public static string ExceptionCannotBeRetried
{
get
{
@@ -42,7 +42,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal static string ErrorParsingConnectionString
public static string ErrorParsingConnectionString
{
get
{
@@ -50,7 +50,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal static string FailedToCacheIsCloud
public static string FailedToCacheIsCloud
{
get
{
@@ -58,7 +58,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal static string FailedToParseConnectionString
public static string FailedToParseConnectionString
{
get
{
@@ -66,7 +66,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal static string IgnoreOnException
public static string IgnoreOnException
{
get
{
@@ -74,7 +74,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal static string InvalidCommandType
public static string InvalidCommandType
{
get
{
@@ -82,7 +82,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal static string InvalidConnectionType
public static string InvalidConnectionType
{
get
{
@@ -106,7 +106,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal static string OnlyReliableConnectionSupported
public static string OnlyReliableConnectionSupported
{
get
{
@@ -114,7 +114,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal static string RetryOnException
public static string RetryOnException
{
get
{
@@ -130,7 +130,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal static string UnableToAssignValue
public static string UnableToAssignValue
{
get
{
@@ -138,7 +138,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal static string UnableToRetrieveAzureSessionId
public static string UnableToRetrieveAzureSessionId
{
get
{

View File

@@ -32,13 +32,13 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// exception to notify the retry policy that no further retry attempts are required.
/// </summary>
[Serializable]
internal sealed class RetryLimitExceededException : Exception
public sealed class RetryLimitExceededException : Exception
{
internal RetryLimitExceededException() : base()
public RetryLimitExceededException() : base()
{
}
internal RetryLimitExceededException(string m, Exception e) : base(m, e)
public RetryLimitExceededException(string m, Exception e) : base(m, e)
{
}
}

View File

@@ -9,12 +9,12 @@ using Microsoft.SqlTools.Utility;
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
{
internal abstract partial class RetryPolicy
public abstract partial class RetryPolicy
{
/// <summary>
/// Provides the error detection logic for temporary faults that are commonly found during data transfer.
/// </summary>
internal class DataTransferErrorDetectionStrategy : ErrorDetectionStrategyBase
public class DataTransferErrorDetectionStrategy : ErrorDetectionStrategyBase
{
private static readonly DataTransferErrorDetectionStrategy instance = new DataTransferErrorDetectionStrategy();

View File

@@ -8,7 +8,7 @@ using System.Data.SqlClient;
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
{
internal abstract partial class RetryPolicy
public abstract partial class RetryPolicy
{
public interface IErrorDetectionStrategy
{
@@ -31,7 +31,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// Base class with common retry logic. The core behavior for retrying non SqlExceptions is the same
/// across retry policies
/// </summary>
internal abstract class ErrorDetectionStrategyBase : IErrorDetectionStrategy
public abstract class ErrorDetectionStrategyBase : IErrorDetectionStrategy
{
public bool CanRetry(Exception ex)
{

View File

@@ -7,13 +7,13 @@ using System.Data.SqlClient;
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
{
internal abstract partial class RetryPolicy
public abstract partial class RetryPolicy
{
/// <summary>
/// Provides the error detection logic for temporary faults that are commonly found in SQL Azure.
/// The same errors CAN occur on premise also, but they are not seen as often.
/// </summary>
internal sealed class NetworkConnectivityErrorDetectionStrategy : ErrorDetectionStrategyBase
public sealed class NetworkConnectivityErrorDetectionStrategy : ErrorDetectionStrategyBase
{
private static NetworkConnectivityErrorDetectionStrategy instance = new NetworkConnectivityErrorDetectionStrategy();

View File

@@ -8,7 +8,7 @@ using System.Data.SqlClient;
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
{
internal abstract partial class RetryPolicy
public abstract partial class RetryPolicy
{
/// <summary>
/// Provides the error detection logic for temporary faults that are commonly found in SQL Azure.
@@ -18,7 +18,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// want to consider this as passing since the first execution that has timed out (or failed for some other temporary error)
/// might have managed to create the object.
/// </summary>
internal class SqlAzureTemporaryAndIgnorableErrorDetectionStrategy : ErrorDetectionStrategyBase
public class SqlAzureTemporaryAndIgnorableErrorDetectionStrategy : ErrorDetectionStrategyBase
{
/// <summary>
/// Azure error that can be ignored

View File

@@ -7,7 +7,7 @@ using System.Data.SqlClient;
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
{
internal abstract partial class RetryPolicy
public abstract partial class RetryPolicy
{
/// <summary>
/// Provides the error detection logic for temporary faults that are commonly found in SQL Azure.

View File

@@ -13,7 +13,7 @@ using System.Text.RegularExpressions;
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
{
internal abstract partial class RetryPolicy
public abstract partial class RetryPolicy
{
/// <summary>
/// Implements an object holding the decoded reason code returned from SQL Azure when encountering throttling conditions.

View File

@@ -36,19 +36,19 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// <summary>
/// Implements a policy defining and implementing the retry mechanism for unreliable actions.
/// </summary>
internal abstract partial class RetryPolicy
public abstract partial class RetryPolicy
{
/// <summary>
/// Defines a callback delegate which will be invoked whenever a retry condition is encountered.
/// </summary>
/// <param name="retryState">The state of current retry attempt.</param>
internal delegate void RetryCallbackDelegate(RetryState retryState);
public delegate void RetryCallbackDelegate(RetryState retryState);
/// <summary>
/// Defines a callback delegate which will be invoked whenever an error is ignored on retry.
/// </summary>
/// <param name="retryState">The state of current retry attempt.</param>
internal delegate void IgnoreErrorCallbackDelegate(RetryState retryState);
public delegate void IgnoreErrorCallbackDelegate(RetryState retryState);
private readonly IErrorDetectionStrategy _errorDetectionStrategy;
@@ -106,7 +106,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// <remarks>
/// This flag is currently being used for TESTING PURPOSES ONLY.
/// </remarks>
internal bool ShouldIgnoreOnFirstTry
public bool ShouldIgnoreOnFirstTry
{
get;
set;
@@ -292,7 +292,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
*/
internal static int? GetErrorNumber(Exception ex)
public static int? GetErrorNumber(Exception ex)
{
SqlException sqlEx = ex as SqlException;
if (sqlEx == null)
@@ -331,7 +331,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal class FixedDelayPolicy : RetryPolicy
public class FixedDelayPolicy : RetryPolicy
{
private readonly int _maxRetryCount;
private readonly TimeSpan _intervalBetweenRetries;
@@ -367,7 +367,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal class ProgressiveRetryPolicy : RetryPolicy
public class ProgressiveRetryPolicy : RetryPolicy
{
private readonly int _maxRetryCount;
private readonly TimeSpan _initialInterval;
@@ -453,7 +453,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal class TimeBasedRetryPolicy : RetryPolicy
public class TimeBasedRetryPolicy : RetryPolicy
{
private readonly TimeSpan _minTotalRetryTimeLimit;
private readonly TimeSpan _maxTotalRetryTimeLimit;
@@ -533,7 +533,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
return new RetryStateEx { TotalRetryTime = TimeSpan.Zero };
}
internal sealed class RetryStateEx : RetryState
public sealed class RetryStateEx : RetryState
{
public TimeSpan TotalRetryTime { get; set; }
}

View File

@@ -61,7 +61,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// <summary>
/// Implements a collection of the RetryPolicyInfo elements holding retry policy settings.
/// </summary>
internal sealed class RetryPolicyFactory
public sealed class RetryPolicyFactory
{
/// <summary>
/// Returns a default policy that does no retries, it just invokes action exactly once.
@@ -77,7 +77,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// Implements a strategy that ignores any transient errors.
/// Internal for testing purposes only
/// </summary>
internal sealed class TransientErrorIgnoreStrategy : RetryPolicy.IErrorDetectionStrategy
public sealed class TransientErrorIgnoreStrategy : RetryPolicy.IErrorDetectionStrategy
{
private static readonly TransientErrorIgnoreStrategy _instance = new TransientErrorIgnoreStrategy();
@@ -101,7 +101,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// Creates and returns a default Retry Policy for Schema based operations.
/// </summary>
/// <returns>An instance of <see cref="RetryPolicy"/> class.</returns>
internal static RetryPolicy CreateDefaultSchemaCommandRetryPolicy(bool useRetry, int retriesPerPhase = RetryPolicyDefaults.DefaulSchemaRetryCount)
public static RetryPolicy CreateDefaultSchemaCommandRetryPolicy(bool useRetry, int retriesPerPhase = RetryPolicyDefaults.DefaulSchemaRetryCount)
{
RetryPolicy policy;
@@ -128,7 +128,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// </summary>
/// <remarks>The RetryOccured event is wired to raise an RaiseAmbientRetryMessage message for a connection retry. </remarks>
/// <returns>An instance of <see cref="RetryPolicy"/> class.</returns>
internal static RetryPolicy CreateSchemaConnectionRetryPolicy(int retriesPerPhase)
public static RetryPolicy CreateSchemaConnectionRetryPolicy(int retriesPerPhase)
{
RetryPolicy policy = new RetryPolicy.ExponentialDelayRetryPolicy(
RetryPolicy.SqlAzureTemporaryErrorDetectionStrategy.Instance,
@@ -145,7 +145,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// </summary>
/// <remarks>The RetryOccured event is wired to raise an RaiseAmbientRetryMessage message for a command retry. </remarks>
/// <returns>An instance of <see cref="RetryPolicy"/> class.</returns>
internal static RetryPolicy CreateSchemaCommandRetryPolicy(int retriesPerPhase)
public static RetryPolicy CreateSchemaCommandRetryPolicy(int retriesPerPhase)
{
RetryPolicy policy = new RetryPolicy.ExponentialDelayRetryPolicy(
RetryPolicy.SqlAzureTemporaryErrorDetectionStrategy.Instance,
@@ -167,7 +167,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// The IgnoreErrorOccurred event is wired to raise an RaiseAmbientIgnoreMessage message for ignore.
/// </remarks>
/// <returns>An instance of <see cref="RetryPolicy"/> class.</returns>
internal static RetryPolicy CreateDatabaseCommandRetryPolicy(params int[] ignorableErrorNumbers)
public static RetryPolicy CreateDatabaseCommandRetryPolicy(params int[] ignorableErrorNumbers)
{
RetryPolicy.SqlAzureTemporaryAndIgnorableErrorDetectionStrategy errorDetectionStrategy =
new RetryPolicy.SqlAzureTemporaryAndIgnorableErrorDetectionStrategy(ignorableErrorNumbers);
@@ -196,7 +196,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// The IgnoreErrorOccurred event is wired to raise an RaiseAmbientIgnoreMessage message for ignore.
/// </remarks>
/// <returns>An instance of <see cref="RetryPolicy"/> class.</returns>
internal static RetryPolicy CreateElementCommandRetryPolicy(params int[] ignorableErrorNumbers)
public static RetryPolicy CreateElementCommandRetryPolicy(params int[] ignorableErrorNumbers)
{
Debug.Assert(ignorableErrorNumbers != null);
@@ -226,7 +226,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// The IgnoreErrorOccurred event is wired to raise an RaiseAmbientIgnoreMessage message for ignore.
/// </remarks>
/// <returns>An instance of <see cref="RetryPolicy"/> class.</returns>
internal static RetryPolicy CreatePrimaryKeyCommandRetryPolicy()
public static RetryPolicy CreatePrimaryKeyCommandRetryPolicy()
{
RetryPolicy.SqlAzureTemporaryAndIgnorableErrorDetectionStrategy errorDetectionStrategy =
new RetryPolicy.SqlAzureTemporaryAndIgnorableErrorDetectionStrategy(SqlErrorNumbers.PrimaryKeyViolationErrorNumber);
@@ -390,7 +390,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
return retryPolicy;
}
internal static void DataConnectionFailureRetry(RetryState retryState)
public static void DataConnectionFailureRetry(RetryState retryState)
{
Logger.Write(TraceEventType.Information, string.Format(CultureInfo.InvariantCulture,
"Connection retry number {0}. Delaying {1} ms before retry. Exception: {2}",
@@ -401,7 +401,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
RetryPolicyUtils.RaiseAmbientRetryMessage(retryState, SqlSchemaModelErrorCodes.ServiceActions.ConnectionRetry);
}
internal static void CommandFailureRetry(RetryState retryState, string commandKeyword)
public static void CommandFailureRetry(RetryState retryState, string commandKeyword)
{
Logger.Write(TraceEventType.Information, string.Format(
CultureInfo.InvariantCulture,
@@ -414,7 +414,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
RetryPolicyUtils.RaiseAmbientRetryMessage(retryState, SqlSchemaModelErrorCodes.ServiceActions.CommandRetry);
}
internal static void CommandFailureIgnore(RetryState retryState, string commandKeyword)
public static void CommandFailureIgnore(RetryState retryState, string commandKeyword)
{
Logger.Write(TraceEventType.Information, string.Format(
CultureInfo.InvariantCulture,
@@ -426,32 +426,32 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
RetryPolicyUtils.RaiseAmbientIgnoreMessage(retryState, SqlSchemaModelErrorCodes.ServiceActions.CommandRetry);
}
internal static void CommandFailureRetry(RetryState retryState)
public static void CommandFailureRetry(RetryState retryState)
{
CommandFailureRetry(retryState, "Command");
}
internal static void CommandFailureIgnore(RetryState retryState)
public static void CommandFailureIgnore(RetryState retryState)
{
CommandFailureIgnore(retryState, "Command");
}
internal static void CreateDatabaseCommandFailureRetry(RetryState retryState)
public static void CreateDatabaseCommandFailureRetry(RetryState retryState)
{
CommandFailureRetry(retryState, "Database Command");
}
internal static void CreateDatabaseCommandFailureIgnore(RetryState retryState)
public static void CreateDatabaseCommandFailureIgnore(RetryState retryState)
{
CommandFailureIgnore(retryState, "Database Command");
}
internal static void ElementCommandFailureRetry(RetryState retryState)
public static void ElementCommandFailureRetry(RetryState retryState)
{
CommandFailureRetry(retryState, "Element Command");
}
internal static void ElementCommandFailureIgnore(RetryState retryState)
public static void ElementCommandFailureIgnore(RetryState retryState)
{
CommandFailureIgnore(retryState, "Element Command");
}

View File

@@ -12,7 +12,7 @@ using Microsoft.SqlTools.Utility;
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
{
internal static class RetryPolicyUtils
public static class RetryPolicyUtils
{
/// <summary>
/// Approved list of transient errors that should be retryable during Network connection stages
@@ -257,7 +257,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// </summary>
/// <param name="currentRetryCount">Total number of retries including the current retry</param>
/// <returns>TimeSpan defining the length of time to delay</returns>
internal static TimeSpan CalcExponentialRetryDelayWithSchemaDefaults(int currentRetryCount)
public static TimeSpan CalcExponentialRetryDelayWithSchemaDefaults(int currentRetryCount)
{
return CalcExponentialRetryDelay(currentRetryCount,
RetryPolicyDefaults.DefaultBackoffIntervalFactor,
@@ -277,7 +277,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// <param name="minInterval">Minimum interval between retries. The basis for all backoff calculations</param>
/// <param name="maxInterval">Maximum interval between retries. Backoff will not take longer than this period.</param>
/// <returns>TimeSpan defining the length of time to delay</returns>
internal static TimeSpan CalcExponentialRetryDelay(int currentRetryCount, double intervalFactor, TimeSpan minInterval, TimeSpan maxInterval)
public static TimeSpan CalcExponentialRetryDelay(int currentRetryCount, double intervalFactor, TimeSpan minInterval, TimeSpan maxInterval)
{
try
{
@@ -298,7 +298,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal static void RaiseAmbientRetryMessage(RetryState retryState, int errorCode)
public static void RaiseAmbientRetryMessage(RetryState retryState, int errorCode)
{
Action<SqlServerRetryError> retryMsgHandler = AmbientSettings.ConnectionRetryMessageHandler;
if (retryMsgHandler != null)
@@ -317,7 +317,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
}
}
internal static void RaiseAmbientIgnoreMessage(RetryState retryState, int errorCode)
public static void RaiseAmbientIgnoreMessage(RetryState retryState, int errorCode)
{
Action<SqlServerRetryError> retryMsgHandler = AmbientSettings.ConnectionRetryMessageHandler;
if (retryMsgHandler != null)
@@ -341,7 +341,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// <param name="retryState"></param>
/// <param name="errorCode"></param>
/// <param name="azureSessionId"></param>
internal static void RaiseSchemaAmbientRetryMessage(RetryState retryState, int errorCode, Guid azureSessionId)
public static void RaiseSchemaAmbientRetryMessage(RetryState retryState, int errorCode, Guid azureSessionId)
{
if (azureSessionId != Guid.Empty)
{

View File

@@ -7,7 +7,7 @@ using System;
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
{
internal class RetryState
public class RetryState
{
private int _retryCount = 0;
private TimeSpan _delay = TimeSpan.Zero;

View File

@@ -5,7 +5,7 @@
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
{
internal static class SqlSchemaModelErrorCodes
public static class SqlSchemaModelErrorCodes
{
private const int ParserErrorCodeStartIndex = 46000;
private const int ParserErrorCodeEndIndex = 46499;

View File

@@ -11,7 +11,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// Represents an error produced by SQL Server database schema provider
/// </summary>
[Serializable]
internal class SqlServerError : DataSchemaError
public class SqlServerError : DataSchemaError
{
private const string SqlServerPrefix = "SQL";
private const string DefaultHelpKeyword = "vs.teamsystem.datatools.DefaultErrorMessageHelp";

View File

@@ -11,7 +11,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
/// <summary>
/// Captures extended information about a specific error and a retry
/// </summary>
internal class SqlServerRetryError : SqlServerError
public class SqlServerRetryError : SqlServerError
{
private int _retryCount;
private int _errorCode;

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 System.Collections.Generic;
namespace Microsoft.SqlTools.ServiceLayer.Connection.Contracts
@@ -74,10 +73,3 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.Contracts
public Dictionary<string, object> Options { get; set; }
}
}
public class ClusterEndpoint
{
public string ServiceName;
public string IpAddress;
public int Port;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -249,64 +249,14 @@ EditDataIncorrectTable(string tableName) = EditData queries must query the origi
############################################################################
# DacFx Resources
EE_BatchSqlMessageNoProcedureInfo = Msg {0}, Level {1}, State {2}, Line {3}
EE_BatchSqlMessageWithProcedureInfo = Msg {0}, Level {1}, State {2}, Procedure {3}, Line {4}
EE_BatchSqlMessageNoLineInfo = Msg {0}, Level {1}, State {2}
EE_BatchError_Exception = An error occurred while the batch was being processed. The error message is: {0}
EE_BatchExecutionInfo_RowsAffected = ({0} row(s) affected)
EE_ExecutionNotYetCompleteError = The previous execution is not yet complete.
EE_ScriptError_Error = A scripting error occurred.
EE_ScriptError_ParsingSyntax = Incorrect syntax was encountered while {0} was being parsed.
EE_ScriptError_FatalError = A fatal error occurred.
EE_ExecutionInfo_FinalizingLoop = Batch execution completed {0} times...
EE_ExecutionInfo_QueryCancelledbyUser = You cancelled the query.
EE_BatchExecutionError_Halting = An error occurred while the batch was being executed.
EE_ExecutionInfo_InitializingLoop = Beginning execution loop
EE_BatchExecutionError_Ignoring = An error occurred while the batch was being executed, but the error has been ignored.
EE_ExecutionInfo_InitializingLoop = Beginning execution loop
EE_ExecutionError_CommandNotSupported = Command {0} is not supported.
EE_ExecutionError_VariableNotFound = The variable {0} could not be found.
BatchParserWrapperExecutionEngineError = SQL Execution error: {0}
EE_ExecutionInfo_FinalizingLoop = Batch execution completed {0} times...
BatchParserWrapperExecutionError = Batch parser wrapper execution: {0} found... at line {1}: {2} Description: {3}
BatchParserWrapperExecutionEngineBatchMessage = Batch parser wrapper execution engine batch message received: Message: {0} Detailed message: {1}
BatchParserWrapperExecutionEngineBatchResultSetProcessing = Batch parser wrapper execution engine batch ResultSet processing: DataReader.FieldCount: {0} DataReader.RecordsAffected: {1}
BatchParserWrapperExecutionEngineBatchResultSetFinished = Batch parser wrapper execution engine batch ResultSet finished.
BatchParserWrapperExecutionEngineBatchCancelling = Canceling batch parser wrapper batch execution.
EE_ScriptError_Warning = Scripting warning.
TroubleshootingAssistanceMessage = For more information about this error, see the troubleshooting topics in the product documentation.
BatchParser_CircularReference = File '{0}' recursively included.
BatchParser_CommentNotTerminated = Missing end comment mark '*/'.
BatchParser_StringNotTerminated = Unclosed quotation mark after the character string.
BatchParser_IncorrectSyntax = Incorrect syntax was encountered while parsing '{0}'.
BatchParser_VariableNotDefined = Variable {0} is not defined.
############################################################################
# Workspace Service
@@ -716,125 +666,6 @@ StoredProcedureScriptParameterComment = -- TODO: Set parameter values here.
ScriptingGeneralError = An error occurred while scripting the objects.
ScriptingExecuteNotSupportedError = Scripting as Execute is only supported for Stored Procedures
############################################################################
# Admin Service
unavailable = Unavailable
filegroup_dialog_defaultFilegroup = Current default filegroup: {0}
filegroup_dialog_title = New Filegroup for {0}
filegroups_default = Default
filegroups_files = Files
filegroups_name = Name
filegroups_readonly = Read-Only
general_autogrowth = Autogrowth / Maxsize
general_builderText = ...
general_default = &lt;default&gt;
general_fileGroup = Filegroup
general_fileName = Logical Name
general_fileType = File Type
general_initialSize = Initial Size (MB)
general_newFilegroup = &lt;new filegroup&gt;
general_path = Path
general_physicalFileName = File Name
general_rawDevice = &lt;raw device&gt;
general_recoveryModel_bulkLogged = Bulk-logged
general_recoveryModel_full = Full
general_recoveryModel_simple = Simple
general_titleSearchOwner = Select Database Owner
prototype_autogrowth_disabled = None
prototype_autogrowth_restrictedGrowthByMB = By {0} MB, Limited to {1} MB
prototype_autogrowth_restrictedGrowthByPercent = By {0} percent, Limited to {1} MB
prototype_autogrowth_unrestrictedGrowthByMB = By {0} MB, Unlimited
prototype_autogrowth_unrestrictedGrowthByPercent = By {0} percent, Unlimited
prototype_autogrowth_unlimitedfilestream = Unlimited
prototype_autogrowth_limitedfilestream = Limited to {0} MB
prototype_db_category_automatic = Automatic
prototype_db_category_servicebroker = Service Broker
prototype_db_category_collation = Collation
prototype_db_category_cursor = Cursor
prototype_db_category_misc = Miscellaneous
prototype_db_category_recovery = Recovery
prototype_db_category_state = State
prototype_db_prop_ansiNullDefault = ANSI NULL Default
prototype_db_prop_ansiNulls = ANSI NULLS Enabled
prototype_db_prop_ansiPadding = ANSI Padding Enabled
prototype_db_prop_ansiWarnings = ANSI Warnings Enabled
prototype_db_prop_arithabort = Arithmetic Abort Enabled
prototype_db_prop_autoClose = Auto Close
prototype_db_prop_autoCreateStatistics = Auto Create Statistics
prototype_db_prop_autoShrink = Auto Shrink
prototype_db_prop_autoUpdateStatistics = Auto Update Statistics
prototype_db_prop_autoUpdateStatisticsAsync = Auto Update Statistics Asynchronously
prototype_db_prop_caseSensitive = Case Sensitive
prototype_db_prop_closeCursorOnCommit = Close Cursor on Commit Enabled
prototype_db_prop_collation = Collation
prototype_db_prop_concatNullYieldsNull = Concatenate Null Yields Null
prototype_db_prop_databaseCompatibilityLevel = Database Compatibility Level
prototype_db_prop_databaseState = Database State
prototype_db_prop_defaultCursor = Default Cursor
prototype_db_prop_fullTextIndexing = Full-Text Indexing Enabled
prototype_db_prop_numericRoundAbort = Numeric Round-Abort
prototype_db_prop_pageVerify = Page Verify
prototype_db_prop_quotedIdentifier = Quoted Identifiers Enabled
prototype_db_prop_readOnly = Database Read-Only
prototype_db_prop_recursiveTriggers = Recursive Triggers Enabled
prototype_db_prop_restrictAccess = Restrict Access
prototype_db_prop_selectIntoBulkCopy = Select Into/Bulk Copy
prototype_db_prop_honorBrokerPriority = Honor Broker Priority
prototype_db_prop_serviceBrokerGuid = Service Broker Identifier
prototype_db_prop_brokerEnabled = Broker Enabled
prototype_db_prop_truncateLogOnCheckpoint = Truncate Log on Checkpoint
prototype_db_prop_dbChaining = Cross-database Ownership Chaining Enabled
prototype_db_prop_trustworthy = Trustworthy
prototype_db_prop_dateCorrelationOptimization = Date Correlation Optimization Enabled
prototype_db_prop_parameterization = Parameterization
prototype_db_prop_parameterization_value_forced = Forced
prototype_db_prop_parameterization_value_simple = Simple
prototype_file_dataFile = ROWS Data
prototype_file_logFile = LOG
prototype_file_filestreamFile = FILESTREAM Data
prototype_file_noFileGroup = Not Applicable
prototype_file_defaultpathstring = &lt;default path&gt;
title_openConnectionsMustBeClosed = Open Connections
warning_openConnectionsMustBeClosed=To change the database properties, SQL Server must close all other connections to the database_ Are you sure you want to change the properties and close all other connections?
prototype_db_prop_databaseState_value_autoClosed = AUTO_CLOSED
prototype_db_prop_databaseState_value_emergency = EMERGENCY
prototype_db_prop_databaseState_value_inaccessible = INACCESSIBLE
prototype_db_prop_databaseState_value_normal = NORMAL
prototype_db_prop_databaseState_value_offline = OFFLINE
prototype_db_prop_databaseState_value_recovering = RECOVERING
prototype_db_prop_databaseState_value_recoveryPending = RECOVERY PENDING
prototype_db_prop_databaseState_value_restoring = RESTORING
prototype_db_prop_databaseState_value_shutdown=SHUTDOWN
prototype_db_prop_databaseState_value_standby = STANDBY
prototype_db_prop_databaseState_value_suspect = SUSPECT
prototype_db_prop_defaultCursor_value_global = GLOBAL
prototype_db_prop_defaultCursor_value_local = LOCAL
prototype_db_prop_restrictAccess_value_multiple = MULTI_USER
prototype_db_prop_restrictAccess_value_restricted = RESTRICTED_USER
prototype_db_prop_restrictAccess_value_single = SINGLE_USER
prototype_db_prop_pageVerify_value_checksum = CHECKSUM
prototype_db_prop_pageVerify_value_none = NONE
prototype_db_prop_pageVerify_value_tornPageDetection = TORN_PAGE_DETECTION
prototype_db_prop_varDecimalEnabled = VarDecimal Storage Format Enabled
compatibilityLevel_katmai = SQL Server 2008 (100)
prototype_db_prop_encryptionEnabled = Encryption Enabled
prototype_db_prop_databasescopedconfig_value_off = OFF
prototype_db_prop_databasescopedconfig_value_on = ON
prototype_db_prop_databasescopedconfig_value_primary = PRIMARY
error_db_prop_invalidleadingColumns = For the distribution policy HASH, the number of leading hash columns is optional but should be from 1 to 16 columns
compatibilityLevel_denali = SQL Server 2012 (110)
compatibilityLevel_sql14 = SQL Server 2014 (120)
compatibilityLevel_sql15 = SQL Server 2016 (130)
compatibilityLevel_sqlvNext = SQL Server vNext (140)
general_containmentType_None = None
general_containmentType_Partial = Partial
filegroups_filestreamFiles = FILESTREAM Files
prototype_file_noApplicableFileGroup = No Applicable Filegroup
NeverBackedUp = Never
Error_InvalidDirectoryName = Path {0} is not a valid directory
Error_ExistingDirectoryName = For directory {0} a file with name {1} already exists
############################################################################
# Backup Service
@@ -895,146 +726,6 @@ StopSessionFailed(String error) = Failed to stop session: {0}
SessionNotFound = Cannot find requested XEvent session
SessionAlreadyExists(String sessionName) = An XEvent session named {0} already exists
#############################################################################
# SQL Agent
EnableAlertsTitle(String serverName) = Enable Alerts - {0}
EnableAlertDescription(String alertName) = Enable Alert '{0}'
EnablingAlert(String alertName) = Enabling Alert '{0}'
EnabledAlert(String alertName) = Enabled Alert '{0}'
DisableAlertsTitle(String serverName) = Disable Alerts - {0}
DisableAlertDescription(String alertName) = Disable Alert '{0}'
DisablingAlert(String alertName) = Disabling Alert '{0}'
DisabledAlert(String alertName) = Disabled Alert '{0}'
EnableJobsTitle(String serverName) = Enable Jobs - {0}
EnableJobDescription(String jobName) = Enable Job '{0}'
EnablingJob(String jobName) = Enabling Job '{0}'
EnabledJob(String jobName) = Enabled Job '{0}'
DisableJobsTitle(String serverName) = Disable Jobs - {0}
DisableJobDescription(String jobName) = Disable Job '{0}'
DisablingJob(String jobName) = Disabling Job '{0}'
DisabledJob(String jobName) = Disabled Job '{0}'
StartJobsTitle(String serverName) = Start Jobs - {0}
StartJobDescription(String jobName) = Start Job '{0}'
GettingStartStep(String jobName) = Job '{0}' has more than one step. Getting step to start
UserCancelledSelectStep = User canceled select step. Job will not be started
StartingJob(String jobName) = Starting Job '{0}'
StartJobWithStep(String jobName, String stepName) = Start Job '{0}' with step '{1}'
RequestPostedToTargetServers = Posted remote job execution request
ExecuteJob(string jobName) = Execute job '{0}'
JobFailed(string jobName) = Execution of job '{0}' failed. See the history log for details.
Executing = Executing
BetweenRetries = Between retries
Suspended = Suspended
PerformingCompletionAction = Performing completion action
WaitingForStepToFinish = Waiting for step to finish
WaitingForWorkerThread = Waiting for worker thread
StopJobsTitle(String serverName) = Stop Jobs - {0}
StopJobDescription(String jobName) = Stop Job '{0}'
StoppingJob(String jobName) = Stopping Job '{0}'
StoppedJob(String jobName) = Stopped Job '{0}'
; First item in database name drop down list
AllDatabases = <all databases>
; Exception thrown when agent alert has unknown severity level
UnknownSeverity(int severity) = Unknown severity: {0}
#severity types
Severity001 = 001 - Miscellaneous System Information
Severity002 = 002 - Reserved
Severity003 = 003 - Reserved
Severity004 = 004 - Reserved
Severity005 = 005 - Reserved
Severity006 = 006 - Reserved
Severity007 = 007 - Notification: Status Information
Severity008 = 008 - Notification: User Intervention Required
Severity009 = 009 - User Defined
Severity010 = 010 - Information
Severity011 = 011 - Specified Database Object Not Found
Severity012 = 012 - Unused
Severity013 = 013 - User Transaction Syntax Error
Severity014 = 014 - Insufficient Permission
Severity015 = 015 - Syntax Error in SQL Statements
Severity016 = 016 - Miscellaneous User Error
Severity017 = 017 - Insufficient Resources
Severity018 = 018 - Nonfatal Internal Error
Severity019 = 019 - Fatal Error in Resource
Severity020 = 020 - Fatal Error in Current Process
Severity021 = 021 - Fatal Error in Database Processes
Severity022 = 022 - Fatal Error: Table Integrity Suspect
Severity023 = 023 - Fatal Error: Database Integrity Suspect
Severity024 = 024 - Fatal Error: Hardware Error
Severity025 = 025 - Fatal Error
; Message box that displayed if start time is more than end time on Mon-Fri
PagerScheduleMonFri = Pager schedule end time is earlier than start time on Mon-Fri. Do you want to continue?
; Message box that displayed if start time is more than end time on Sat-Sun
PagerScheduleSatSun = Pager schedule end time is earlier than start time on Sat-Sun. Do you want to continue?
; Message box caption
PagerScheduleWarning = Pager schedule warning
; Tree node name
General = General
; Tree node name
Notifications = Notifications
; Tree node name
History = History
; Pager schedule grid column name
Day = Day
; Pager schedule grid column name
StartTime = Start Time
; Pager schedule grid column name
EndTime = End Time
; Exception thrown when column index is invalid
ColumnIndexIsInvalid = Column index is invalid.
; Exception thrown when row index is invalid
RowIndexIsInvalid = Row index is invalid.
; Name of the operator dialog in create new operator mode
NewOperatorProperties = New Operator
; Name of the operator dialog in modify operator mode
OperatorProperties(string operatorName) = {0} Properties
; Exception thrown when dialog cannot be created/intialized.
FailedToCreateInitializeAgentOperatorDialog = Unable to create/initialize Agent Operator dialog.
; Exception thrown when job server is not available
JobServerIsNotAvailable = Job server is not available.
; Exception thrown when we cannot create/initialize agent operators general page
CannotCreateInitializeGeneralPage = Cannot create/initialize General page.
; Exception thrown when we cannot create/initialize agent operators notifications page
CannotCreateInitializeNotificationsPage = Cannot create/initialize Notifications page.
; Exception thrown when we cannot create/initialize agent operators history page
CannotCreateInitializeHistoryPage = Cannot create/initialize History page.
; Exception throw when dialog cannot refresh operator
CannotResetOperator = Cannot reset operator.
; Name of label on notifications page
AlertList = Alert list:
; Name of label on notifications page
JobList = Job list:
; Name of column on notifications page
Email = E-mail
; Name of column on notifications page
Pager = Pager
; Name of column on notifications page
AlertName = Alert name
; Name of column on notifications page
JobName = Job name
; Completion Action
Always = Always
; Completion Action
Never = Never
; Completion Action
OnFailure = On failure
; Completion Action
OnSuccess = On success
; Exception thrown when we cannot modify alerts
CannotModifyAlerts = Cannot modify alerts.
; Exception thrown when we cannot create script that modify alerts
CannotCreateScriptForModifyAlerts = Cannot create script for modify alerts.
;job categories
CategoryLocal = [Uncategorized (Local)]
@@ -1082,3 +773,13 @@ StartTimeGreaterThanEndTime = The job schedule starting time cannot be after the
EndTimeEqualToStartTime = The job schedule ending time must be after the starting time.
InvalidStartDate = Start date must be on or after January 1, 1990.
ScheduleNameAlreadyExists(string scheduleName)=There is already a schedule named '{0}' for this job. You must specify a different name.
; Exception thrown when job server is not available
JobServerIsNotAvailable = Job server is not available
############################################################################
# Admin Service
NeverBackedUp = Never
Error_InvalidDirectoryName = Path {0} is not a valid directory
Error_ExistingDirectoryName = For directory {0} a file with name {1} already exist

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,7 @@
<PackageReference Include="System.Data.SqlClient" Version="4.6.0" />
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="$(SmoPackageVersion)" />
<PackageReference Include="Microsoft.SqlServer.DacFx" Version="150.4240.1-preview" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.6.0-preview3-26501-04" />
</ItemGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
@@ -32,18 +32,11 @@
<ItemGroup>
<ProjectReference Include="../Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" />
<ProjectReference Include="../Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" />
<ProjectReference Include="../Microsoft.SqlTools.ManagedBatchParser/Microsoft.SqlTools.ManagedBatchParser.csproj" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ObjectExplorer\SmoModel\TreeNodeDefinition.xml" />
<EmbeddedResource Include="Localization\sr.resx" />
<None Include="Localization\sr.strings" />
</ItemGroup>
<ItemGroup>
<Compile Update="Connection\ReliableConnection\ReliableSqlCommand.cs">
<SubType>Component</SubType>
</Compile>
<Compile Update="Connection\ReliableConnection\ReliableSqlConnection.cs">
<SubType>Component</SubType>
</Compile>
</ItemGroup>
</Project>

View File

@@ -43,6 +43,7 @@ using System.Runtime.InteropServices;
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer.UnitTests")]
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer.IntegrationTests")]
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ManagedBatchParser.UnitTests")]
[assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer.Test.Common")]
// Allowing internals visible access to Moq library to help testing

File diff suppressed because it is too large Load Diff

View File

@@ -13,6 +13,10 @@
"through2": "^2.0.3"
},
"devDependencies": {},
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/sqltoolsservice.git"
},
"author": "Microsoft",
"license": "MIT"
}

View File

@@ -8,7 +8,7 @@ using System.Data.SqlClient;
using System.Diagnostics;
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.BatchParser
namespace Microsoft.SqlTools.ManagedBatchParser.UnitTests.BatchParser
{
internal class BatchParserMockEventHandler : IBatchEventsHandler
{

View File

@@ -10,7 +10,7 @@ using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
using Moq;
using Xunit;
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.BatchParser
namespace Microsoft.SqlTools.ManagedBatchParser.UnitTests.BatchParser
{
public class BatchParserSqlCmdTests : IDisposable
{

View File

@@ -11,10 +11,11 @@ using Microsoft.SqlTools.ServiceLayer.BatchParser;
using Microsoft.SqlTools.ServiceLayer.Test.Common;
using Microsoft.SqlTools.ServiceLayer.Test.Common.Baselined;
using Xunit;
using Microsoft.SqlTools.ServiceLayer.QueryExecution;
using Microsoft.SqlTools.ServiceLayer.Utility;
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
using Microsoft.SqlTools.ServiceLayer.IntegrationTests.TSQLExecutionEngine;
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.BatchParser
namespace Microsoft.SqlTools.ManagedBatchParser.UnitTests.BatchParser
{
public class BatchParserTests : BaselinedTest
{
@@ -53,6 +54,25 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.BatchParser
}
}
[Fact]
public void VerifyExecuteScript()
{
string query = "select @@version";
ExecutionEngineTest executionEngineTest = new ExecutionEngineTest();
executionEngineTest.TestInitialize();
using (ExecutionEngine engine = new ExecutionEngine())
{
engine.ExecuteScript(query);
}
}
[Fact]
public void CanceltheBatch()
{
Batch batch = new Batch();
batch.Cancel();
}
private static Stream GenerateStreamFromString(string s)
{
MemoryStream stream = new MemoryStream();

View File

@@ -1,9 +1,14 @@
using System;
//
// 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.BatchParser;
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
using Xunit;
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.BatchParser
namespace Microsoft.SqlTools.ManagedBatchParser.UnitTests.BatchParser
{
public class BatchParserWrapperTests
{
@@ -20,7 +25,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.BatchParser
Assert.Equal(1, batch.StartLine);
Assert.Equal(1, batch.StartColumn);
Assert.Equal(2, batch.EndLine);
Assert.Equal(sqlScript.Length+1, batch.EndColumn);
Assert.Equal(sqlScript.Length + 1, batch.EndColumn);
Assert.Equal(1, batch.BatchExecutionCount);
}
}
@@ -51,7 +56,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.BatchParser
Assert.Equal(1, batch.StartLine);
Assert.Equal(1, batch.StartColumn);
Assert.Equal(2, batch.EndLine);
Assert.Equal(sqlScript.Length+1, batch.EndColumn);
Assert.Equal(sqlScript.Length + 1, batch.EndColumn);
}
}

View File

@@ -9,7 +9,7 @@ using System.Text;
using System.Globalization;
using Microsoft.SqlTools.ServiceLayer.BatchParser;
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.BatchParser
namespace Microsoft.SqlTools.ManagedBatchParser.UnitTests.BatchParser
{
internal class TestCommandHandler : ICommandHandler
{

View File

@@ -8,7 +8,7 @@ using System.Collections.Generic;
using System.Text;
using Microsoft.SqlTools.ServiceLayer.BatchParser;
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.BatchParser
namespace Microsoft.SqlTools.ManagedBatchParser.UnitTests.BatchParser
{
internal sealed class TestVariableResolver : IVariableResolver
{

View File

@@ -22,11 +22,11 @@
<Reference Include="Castle.Core">
<HintPath>../../bin/ref/Castle.Core.dll</HintPath>
</Reference>
<ProjectReference Include="../../src/Microsoft.SqlTools.ServiceLayer/Microsoft.SqlTools.ServiceLayer.csproj" />
<ProjectReference Include="../../src/Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" />
<ProjectReference Include="../../src/Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" />
<ProjectReference Include="../Microsoft.SqlTools.ServiceLayer.Test.Common/Microsoft.SqlTools.ServiceLayer.Test.Common.csproj" />
<ProjectReference Include="..\Microsoft.SqlTools.ServiceLayer.UnitTests\Microsoft.SqlTools.ServiceLayer.UnitTests.csproj" />
<ProjectReference Include="../../src/Microsoft.SqlTools.ManagedBatchParser/Microsoft.SqlTools.ManagedBatchParser.csproj" />
<ProjectReference Include="../Microsoft.SqlTools.ServiceLayer.UnitTests/Microsoft.SqlTools.ServiceLayer.UnitTests.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Net.Http" Version="4.3.1" />

View File

@@ -15,7 +15,7 @@
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.6.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.6.0-preview3-26501-04" />
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="$(SmoPackageVersion)" />
</ItemGroup>
<ItemGroup>

View File

@@ -26,16 +26,6 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility
Assert.NotNull(ServiceLayerSr.QueryServiceFileWrapperNotInitialized);
Assert.NotNull(ServiceLayerSr.QueryServiceColumnNull);
Assert.NotNull(ServiceLayerSr.Culture);
Assert.NotNull(ServiceLayerSr.BatchParser_CircularReference);
Assert.NotNull(ServiceLayerSr.BatchParser_CommentNotTerminated);
Assert.NotNull(ServiceLayerSr.BatchParser_IncorrectSyntax);
Assert.NotNull(ServiceLayerSr.BatchParser_StringNotTerminated);
Assert.NotNull(ServiceLayerSr.BatchParser_VariableNotDefined);
Assert.NotNull(ServiceLayerSr.BatchParserWrapperExecutionEngineBatchCancelling);
Assert.NotNull(ServiceLayerSr.BatchParserWrapperExecutionEngineBatchMessage);
Assert.NotNull(ServiceLayerSr.BatchParserWrapperExecutionEngineBatchResultSetFinished);
Assert.NotNull(ServiceLayerSr.BatchParserWrapperExecutionEngineBatchResultSetProcessing);
Assert.NotNull(ServiceLayerSr.BatchParserWrapperExecutionEngineError);
Assert.NotNull(ServiceLayerSr.BatchParserWrapperExecutionError);
Assert.NotNull(ServiceLayerSr.ConnectionParamsValidateNullConnection);
Assert.NotNull(ServiceLayerSr.ConnectionParamsValidateNullOwnerUri);
@@ -48,23 +38,6 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility
Assert.NotNull(ServiceLayerSr.ConnectionServiceDbErrorDefaultNotConnected(""));
Assert.NotNull(ServiceLayerSr.ConnectionServiceListDbErrorNotConnected(""));
Assert.NotNull(ServiceLayerSr.ConnectionServiceListDbErrorNullOwnerUri);
Assert.NotNull(ServiceLayerSr.EE_BatchError_Exception);
Assert.NotNull(ServiceLayerSr.EE_BatchExecutionError_Halting);
Assert.NotNull(ServiceLayerSr.EE_BatchExecutionError_Ignoring);
Assert.NotNull(ServiceLayerSr.EE_BatchExecutionInfo_RowsAffected);
Assert.NotNull(ServiceLayerSr.EE_BatchSqlMessageNoLineInfo);
Assert.NotNull(ServiceLayerSr.EE_BatchSqlMessageNoProcedureInfo);
Assert.NotNull(ServiceLayerSr.EE_BatchSqlMessageWithProcedureInfo);
Assert.NotNull(ServiceLayerSr.EE_ExecutionError_CommandNotSupported);
Assert.NotNull(ServiceLayerSr.EE_ExecutionError_VariableNotFound);
Assert.NotNull(ServiceLayerSr.EE_ExecutionInfo_FinalizingLoop);
Assert.NotNull(ServiceLayerSr.EE_ExecutionInfo_InitializingLoop);
Assert.NotNull(ServiceLayerSr.EE_ExecutionInfo_QueryCancelledbyUser);
Assert.NotNull(ServiceLayerSr.EE_ExecutionNotYetCompleteError);
Assert.NotNull(ServiceLayerSr.EE_ScriptError_Error);
Assert.NotNull(ServiceLayerSr.EE_ScriptError_FatalError);
Assert.NotNull(ServiceLayerSr.EE_ScriptError_ParsingSyntax);
Assert.NotNull(ServiceLayerSr.EE_ScriptError_Warning);
Assert.NotNull(ServiceLayerSr.ErrorEmptyStringReplacement);
Assert.NotNull(ServiceLayerSr.PeekDefinitionAzureError(""));
Assert.NotNull(ServiceLayerSr.PeekDefinitionDatabaseError);
@@ -104,7 +77,6 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility
Assert.NotNull(ServiceLayerSr.QueryServiceSubsetBatchOutOfRange);
Assert.NotNull(ServiceLayerSr.QueryServiceSubsetResultSetOutOfRange);
Assert.NotNull(ServiceLayerSr.TestLocalizationConstant);
Assert.NotNull(ServiceLayerSr.TroubleshootingAssistanceMessage);
Assert.NotNull(ServiceLayerSr.WorkspaceServiceBufferPositionOutOfOrder(0,0,0,0));
Assert.NotNull(ServiceLayerSr.WorkspaceServicePositionColumnOutOfRange(0));
Assert.NotNull(ServiceLayerSr.WorkspaceServicePositionLineOutOfRange);