diff --git a/docs/guide/object_explorer.md b/docs/guide/object_explorer.md
index 7836889b..5dff5043 100644
--- a/docs/guide/object_explorer.md
+++ b/docs/guide/object_explorer.md
@@ -51,7 +51,7 @@ For example, to get the table node, we also need to get three properties IsSyste
TableTemporalType.None
TableTemporalType.SystemVersioned
-
+
LedgerTableType.None
LedgerTableType.UpdatableLedgerTable
LedgerTableType.AppendOnlyLedgerTable
@@ -60,7 +60,7 @@ For example, to get the table node, we also need to get three properties IsSyste
-
+
@@ -72,10 +72,10 @@ For example, to get the table node, we also need to get three properties IsSyste
-
+
TableTemporalType.HistoryTable
-
+
LedgerTableType.HistoryTable
diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoTreeNodes.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoTreeNodes.cs
index b0985999..84718129 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoTreeNodes.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoTreeNodes.cs
@@ -216,7 +216,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
properties.Add(new NodeSmoProperty
{
Name = "IsLedger",
- ValidFor = ValidForFlag.AllOnPrem
+ ValidFor = ValidForFlag.Sql2022OrHigher
});
return properties;
}
@@ -700,7 +700,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
NodeType = "Folder",
NodeTypeId = NodeTypes.Synonyms,
IsSystemObject = false,
- ValidFor = ValidForFlag.Sql2005|ValidForFlag.Sql2008|ValidForFlag.Sql2012|ValidForFlag.Sql2014|ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.Sql2019|ValidForFlag.Sql2022|ValidForFlag.AzureV12,
+ ValidFor = ValidForFlag.AllOnPrem|ValidForFlag.AzureV12,
SortPriority = SmoTreeNode.NextSortPriority,
});
currentChildren.Add(new FolderNode {
@@ -716,7 +716,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
NodeType = "Folder",
NodeTypeId = NodeTypes.ExternalResources,
IsSystemObject = false,
- ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.Sql2019|ValidForFlag.Sql2022|ValidForFlag.AzureV12|ValidForFlag.SqlOnDemand,
+ ValidFor = ValidForFlag.Sql2016OrHigher|ValidForFlag.AzureV12|ValidForFlag.SqlOnDemand,
SortPriority = SmoTreeNode.NextSortPriority,
});
currentChildren.Add(new FolderNode {
@@ -783,7 +783,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
{
Property = "TemporalType",
Type = typeof(Enum),
- ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.Sql2019|ValidForFlag.Sql2022|ValidForFlag.AzureV12,
+ ValidFor = ValidForFlag.Sql2016OrHigher|ValidForFlag.AzureV12,
Values = new List
@@ -45,7 +45,7 @@
@@ -76,25 +76,25 @@
-
+
TableTemporalType.None
TableTemporalType.SystemVersioned
-
+
LedgerTableType.None
LedgerTableType.AppendOnlyLedgerTable
LedgerTableType.UpdatableLedgerTable
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -104,7 +104,7 @@
-
+
@@ -113,7 +113,7 @@
-
+
@@ -126,7 +126,7 @@
-->
-
+
@@ -173,21 +173,21 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -253,7 +253,7 @@
-
+
@@ -271,9 +271,9 @@
-
+
-
+
@@ -296,7 +296,7 @@
-
+
@@ -309,7 +309,7 @@
-->
-
+
@@ -322,8 +322,8 @@
-
-
+
+
@@ -335,7 +335,7 @@
-
+
IndexKeyType.DriPrimaryKey
IndexKeyType.DriUniqueKey
@@ -351,11 +351,11 @@
-
+
-
-
+
+
@@ -433,15 +433,15 @@
-->
-
+
-
+
-
+
@@ -459,24 +459,24 @@
-
+
-
-
-
-
+
+
+
+
-
-
+
+
diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/ValidForFlag.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/ValidForFlag.cs
index b428e98e..efe1256f 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/ValidForFlag.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/ValidForFlag.cs
@@ -26,11 +26,16 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
AzureSqlDWGen3 = 0x200,
Sql2019 = 0x400,
Sql2022 = 0x800,
- AllOnPrem = Sql2005 | Sql2008 | Sql2012 | Sql2014 | Sql2016 | Sql2017 | Sql2019 | Sql2022,
+ Sql2022OrHigher = Sql2022,
+ Sql2017OrHigher = Sql2017 | Sql2019 | Sql2022OrHigher,
+ Sql2016OrHigher = Sql2016 | Sql2017OrHigher,
+ Sql2012OrHigher = Sql2012 | Sql2014 | Sql2016OrHigher,
+ Sql2008OrHigher = Sql2008 | Sql2012OrHigher,
+ AllOnPrem = Sql2005 | Sql2008OrHigher,
AllAzure = AzureV12,
- All = Sql2005 | Sql2008 | Sql2012 | Sql2014 | Sql2016 | Sql2017 | Sql2019 | Sql2022 | AzureV12 | SqlDw | SqlOnDemand,
- NotSqlDw = Sql2005 | Sql2008 | Sql2012 | Sql2014 | Sql2016 | Sql2017 | Sql2019 | Sql2022 | AzureV12 | SqlOnDemand,
- NotSqlDemand = Sql2005 | Sql2008 | Sql2012 | Sql2014 | Sql2016 | Sql2017 | Sql2019 | Sql2022 | AzureV12 | SqlDw,
- NotSqlDwNotDemand = Sql2005 | Sql2008 | Sql2012 | Sql2014 | Sql2016 | Sql2017 | Sql2019 | Sql2022 | AzureV12,
+ All = AllOnPrem | AzureV12 | SqlDw | SqlOnDemand,
+ NotSqlDw = AllOnPrem | AzureV12 | SqlOnDemand,
+ NotSqlDemand = AllOnPrem | AzureV12 | SqlDw,
+ NotSqlDwNotDemand = AllOnPrem | AzureV12,
}
}
diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ObjectExplorer/NodeFilterTests.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ObjectExplorer/NodeFilterTests.cs
index f8fcebef..cf18c599 100644
--- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ObjectExplorer/NodeFilterTests.cs
+++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ObjectExplorer/NodeFilterTests.cs
@@ -23,7 +23,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ObjectExplorer
Property = "TemporalType",
Type = typeof(Enum),
TypeToReverse = typeof(SqlHistoryTableQuerier),
- ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.Sql2019|ValidForFlag.Sql2022|ValidForFlag.AzureV12,
+ ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.Sql2019|ValidForFlag.Sql2022OrHigher|ValidForFlag.AzureV12,
Values = new List
{
{ TableTemporalType.HistoryTable }
@@ -36,7 +36,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ObjectExplorer
Property = "LedgerType",
Type = typeof(Enum),
TypeToReverse = typeof(SqlHistoryTableQuerier),
- ValidFor = ValidForFlag.Sql2022|ValidForFlag.AzureV12,
+ ValidFor = ValidForFlag.Sql2022OrHigher|ValidForFlag.AzureV12,
Values = new List
{
{ LedgerTableType.HistoryTable }
@@ -64,7 +64,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ObjectExplorer
}
};
- string allFiltersValid = orNode.ToPropertyFilterString(typeof(SqlHistoryTableQuerier), ValidForFlag.Sql2022);
+ string allFiltersValid = orNode.ToPropertyFilterString(typeof(SqlHistoryTableQuerier), ValidForFlag.Sql2022OrHigher);
string expectedAllFilters = "((@TemporalType = 1) or (@LedgerType = 1))";
Assert.That(allFiltersValid, Is.EqualTo(expectedAllFilters), "ToPropertyFilterString did not construct the URN filter string as expected for NodeOrFilter");
@@ -72,7 +72,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ObjectExplorer
string expectedSql2016Filters = "((@TemporalType = 1))";
Assert.That(sql2016ServerVersion, Is.EqualTo(expectedSql2016Filters), "ToPropertyFilterString did not construct the URN filter string as expected when excluding filters that aren't valid for the given server type.");
- string invalidQuerierType = orNode.ToPropertyFilterString(typeof(SqlTableQuerier), ValidForFlag.Sql2022);
+ string invalidQuerierType = orNode.ToPropertyFilterString(typeof(SqlTableQuerier), ValidForFlag.Sql2022OrHigher);
Assert.That(invalidQuerierType, Is.Empty, "ToPropertyFilterString should return empty string, because no given filters match the querier type provided.");
}
@@ -91,7 +91,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ObjectExplorer
}
};
- string allFiltersValid = INodeFilter.GetPropertyFilter(nodeList, typeof(SqlHistoryTableQuerier), ValidForFlag.Sql2022);
+ string allFiltersValid = INodeFilter.GetPropertyFilter(nodeList, typeof(SqlHistoryTableQuerier), ValidForFlag.Sql2022OrHigher);
string expectedAllFilters = "[((@TemporalType = 1) or (@LedgerType = 1))]";
Assert.That(allFiltersValid, Is.EqualTo(expectedAllFilters), "GetPropertyFilter did not construct the URN filter string as expected");
}
@@ -107,7 +107,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ObjectExplorer
LedgerHistoryFilter
};
- string allFiltersValid = INodeFilter.GetPropertyFilter(nodeList, typeof(SqlHistoryTableQuerier), ValidForFlag.Sql2022);
+ string allFiltersValid = INodeFilter.GetPropertyFilter(nodeList, typeof(SqlHistoryTableQuerier), ValidForFlag.Sql2022OrHigher);
string expectedAllFilters = "[(@TemporalType = 1) and (@LedgerType = 1)]";
Assert.That(allFiltersValid, Is.EqualTo(expectedAllFilters), "GetPropertyFilter did not construct the URN filter string as expected");
@@ -115,7 +115,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ObjectExplorer
string expectedSql2016Filters = "[(@TemporalType = 1)]";
Assert.That(sql2016ServerVersion, Is.EqualTo(expectedSql2016Filters), "GetPropertyFilter did not construct the URN filter string as expected when excluding filters that aren't valid for the given server type.");
- string invalidQuerierType = INodeFilter.GetPropertyFilter(nodeList, typeof(SqlTableQuerier), ValidForFlag.Sql2022);
+ string invalidQuerierType = INodeFilter.GetPropertyFilter(nodeList, typeof(SqlTableQuerier), ValidForFlag.Sql2022OrHigher);
Assert.That(invalidQuerierType, Is.Empty, "GetPropertyFilter should return empty string, because no given filters match the querier type provided.");
}
@@ -137,7 +137,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ObjectExplorer
SystemObjectFilter
};
- string allFiltersValid = INodeFilter.GetPropertyFilter(nodeList, typeof(SqlHistoryTableQuerier), ValidForFlag.Sql2022);
+ string allFiltersValid = INodeFilter.GetPropertyFilter(nodeList, typeof(SqlHistoryTableQuerier), ValidForFlag.Sql2022OrHigher);
string expectedAllFilters = "[((@TemporalType = 1) or (@LedgerType = 1)) and (@IsSystemObject = 1)]";
Assert.That(allFiltersValid, Is.EqualTo(expectedAllFilters), "GetPropertyFilter did not construct the URN filter string as expected");
@@ -145,7 +145,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ObjectExplorer
string expectedSql2016Filters = "[((@TemporalType = 1)) and (@IsSystemObject = 1)]";
Assert.That(sql2016ServerVersion, Is.EqualTo(expectedSql2016Filters), "GetPropertyFilter did not construct the URN filter string as expected when excluding filters that aren't valid for the given server type.");
- string invalidQuerierType = INodeFilter.GetPropertyFilter(nodeList, typeof(SqlTableQuerier), ValidForFlag.Sql2022);
+ string invalidQuerierType = INodeFilter.GetPropertyFilter(nodeList, typeof(SqlTableQuerier), ValidForFlag.Sql2022OrHigher);
string expectedTableQuerierFilters = "[(@IsSystemObject = 1)]";
Assert.That(invalidQuerierType, Is.EqualTo(expectedTableQuerierFilters), "GetPropertyFilter did not construct the URN filter string as expected when excluding filters that don't match the querier type.");
}
@@ -179,7 +179,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ObjectExplorer
orNode2
};
- string allFiltersValid = INodeFilter.GetPropertyFilter(nodeList, typeof(SqlHistoryTableQuerier), ValidForFlag.Sql2022);
+ string allFiltersValid = INodeFilter.GetPropertyFilter(nodeList, typeof(SqlHistoryTableQuerier), ValidForFlag.Sql2022OrHigher);
string expectedAllFilters = "[((@TemporalType = 1) or (@LedgerType = 1)) and (@IsSystemObject = 1) and ((@IsSystemObject = 1) or (@LedgerType = 1) or (@TemporalType = 1))]";
Assert.That(allFiltersValid, Is.EqualTo(expectedAllFilters), "GetPropertyFilter did not construct the URN filter string as expected");
@@ -187,7 +187,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ObjectExplorer
string expectedSql2016Filters = "[((@TemporalType = 1)) and (@IsSystemObject = 1) and ((@IsSystemObject = 1) or (@TemporalType = 1))]";
Assert.That(sql2016ServerVersion, Is.EqualTo(expectedSql2016Filters), "GetPropertyFilter did not construct the URN filter string as expected when excluding filters that aren't valid for the given server type.");
- string invalidQuerierType = INodeFilter.GetPropertyFilter(nodeList, typeof(SqlTableQuerier), ValidForFlag.Sql2022);
+ string invalidQuerierType = INodeFilter.GetPropertyFilter(nodeList, typeof(SqlTableQuerier), ValidForFlag.Sql2022OrHigher);
string expectedTableQuerierFilters = "[(@IsSystemObject = 1) and ((@IsSystemObject = 1))]";
Assert.That(invalidQuerierType, Is.EqualTo(expectedTableQuerierFilters), "GetPropertyFilter did not construct the URN filter string as expected when excluding filters that don't match the querier type.");
}