added a binding queue for oe to force one operation on a node at a time (#441)

* added a binding queue for oe to force one operation on a node at a time

* setting node subtype to temporal for temporal tables

* disposing oe service on shutdown
This commit is contained in:
Leila Lali
2017-08-22 15:15:01 -07:00
committed by GitHub
parent d94dda4282
commit eb61423f89
9 changed files with 156 additions and 38 deletions

View File

@@ -128,6 +128,15 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
}
typeName += ")";
break;
case SqlDataType.Numeric:
case SqlDataType.Decimal:
typeName += $"({dataType.NumericPrecision},{dataType.NumericScale})";
break;
case SqlDataType.DateTime2:
case SqlDataType.Time:
case SqlDataType.DateTimeOffset:
typeName += $"({dataType.NumericScale})";
break;
}
}
return typeName;

View File

@@ -29,6 +29,26 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
return string.Empty;
}
public override string GetNodeSubType(object context)
{
try
{
Table table = context as Table;
if (table != null && table.TemporalType != TableTemporalType.None)
{
return "Temporal";
}
// return string.Empty;
}
catch
{
//Ignore the exception and just not change create custom name
}
return string.Empty;
}
}
/// <summary>

View File

@@ -77,6 +77,7 @@
</Filters>
<Properties>
<Property Name="IsSystemVersioned" ValidFor="Sql2016|Sql2017|AzureV12"/>
<Property Name="TemporalType" ValidFor="Sql2016|Sql2017|AzureV12"/>
</Properties>
<Child Name="SystemTables" IsSystemObject="1"/>
<!--
@@ -201,6 +202,7 @@
<Value>IndexKeyType.DriUniqueKey</Value>
</Filter>
</Filters>
</Node>
<Node Name="Constraints" LocLabel="SR.SchemaHierarchy_Constraints" BaseClass="ModelBased" NodeType="Constraint" Strategy="ElementsInRelationship" ChildQuerierTypes="SqlDefaultConstraint;SqlCheck"/>
<Node Name="Triggers" LocLabel="SR.SchemaHierarchy_Triggers" BaseClass="ModelBased" Strategy="ElementsInRelationship" NodeType="Trigger" ChildQuerierTypes="SqlDmlTrigger" ValidFor="Sql2005|Sql2008|Sql2012|Sql2014|Sql2016|Sql2017|AzureV12"/>

View File

@@ -1,13 +1,13 @@
using System;
using System.Collections.Generic;
using System.Composition;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlTools.ServiceLayer;
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes;
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
{
using System;
using System.Collections.Generic;
using System.Composition;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlTools.ServiceLayer;
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes;
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
{
internal sealed partial class DatabaseTreeNode : SmoTreeNode
{
public DatabaseTreeNode() : base()
@@ -775,6 +775,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
Name = "IsSystemVersioned",
ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12
});
properties.Add(new NodeSmoProperty
{
Name = "TemporalType",
ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.AzureV12
});
return properties;
}
}
@@ -3965,5 +3970,5 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
}
}
}
}