mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-23 01:25:42 -05:00
fixed the oe integration test failing in appveyor (#339)
* fixed the oe integration test failing in appveyor
This commit is contained in:
@@ -298,6 +298,10 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
Logger.Write(LogLevel.Error, $"Failed populating oe children error:{ex.Message} {ex.Source}");
|
||||
}
|
||||
finally
|
||||
{
|
||||
EndChildrenInit();
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
internal async Task<ObjectExplorerSession> DoCreateSession(ConnectionDetails connectionDetails, string uri)
|
||||
{
|
||||
ObjectExplorerSession session;
|
||||
|
||||
connectionDetails.PersistSecurityInfo = true;
|
||||
ConnectParams connectParams = new ConnectParams() { OwnerUri = uri, Connection = connectionDetails };
|
||||
|
||||
ConnectionCompleteParams connectionResult = await Connect(connectParams);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using Microsoft.SqlServer.Management.Smo;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
{
|
||||
@@ -55,19 +56,26 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
|
||||
private static string GetCustomizedLabel(Column column, UserDefinedDataTypeCollection uddts)
|
||||
{
|
||||
if (column.Computed)
|
||||
try
|
||||
{
|
||||
return GetComutedColumnLabel(column, uddts);
|
||||
if (column.Computed)
|
||||
{
|
||||
return GetComputedColumnLabel(column, uddts);
|
||||
}
|
||||
else if (column.IsColumnSet)
|
||||
{
|
||||
return GetColumnSetLabel(column, uddts);
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetSimpleColumnLabel(column, uddts);
|
||||
}
|
||||
}
|
||||
else if (column.IsColumnSet)
|
||||
catch(Exception ex)
|
||||
{
|
||||
return GetColumnSetLabel(column, uddts);
|
||||
Logger.Write(LogLevel.Error, $"Failed to get customized column name. error:{ex.Message}");
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetSimpleColumnLabel(column, uddts);
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
private static string GetTypeSpecifierLabel(DataType dataType, UserDefinedDataTypeCollection uddts)
|
||||
@@ -88,10 +96,16 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
|
||||
}
|
||||
|
||||
if(dataType.SqlDataType == SqlDataType.UserDefinedDataType && uddts != null && uddts.Contains(dataType.Name))
|
||||
if(dataType.SqlDataType == SqlDataType.UserDefinedDataType && uddts != null)
|
||||
{
|
||||
var uddt = uddts[dataType.Name];
|
||||
typeName += $"({uddt.SystemType})";
|
||||
foreach (UserDefinedDataType item in uddts)
|
||||
{
|
||||
if(item.Name == dataType.Name)
|
||||
{
|
||||
typeName += $"({item.SystemType})";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// These types support Length
|
||||
@@ -214,7 +228,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
isNullable);
|
||||
}
|
||||
|
||||
private static string GetComutedColumnLabel(Column column, UserDefinedDataTypeCollection uddts)
|
||||
private static string GetComputedColumnLabel(Column column, UserDefinedDataTypeCollection uddts)
|
||||
{
|
||||
string columnType = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user