Query execution settings support (#812)

* WIP

* WIP 3

* WIP 3

* Additional query settings updates

* Add settings tets

* Address code review feeback

* Updates from testing
This commit is contained in:
Karl Burtram
2019-05-16 15:21:17 -07:00
committed by GitHub
parent db70f421ae
commit 151a2de625
14 changed files with 1119 additions and 69 deletions

View File

@@ -17,9 +17,9 @@ namespace Microsoft.SqlTools.Utility
Options = new Dictionary<string, object>();
}
public T GetOptionValue<T>(string name)
public T GetOptionValue<T>(string name, T defaultValue = default(T))
{
T result = default(T);
T result = defaultValue;
if (Options != null && Options.ContainsKey(name))
{
object value = Options[name];
@@ -29,7 +29,7 @@ namespace Microsoft.SqlTools.Utility
}
catch
{
result = default(T);
result = defaultValue;
Logger.Write(TraceEventType.Warning, string.Format(CultureInfo.InvariantCulture,
"Cannot convert option value {0}:{1} to {2}", name, value ?? "", typeof(T)));
}